From e9330dcc5c77ae7004d5141b4c2653dc1ffc7242 Mon Sep 17 00:00:00 2001 From: Phil Freeman Date: Sun, 2 Apr 2017 15:01:30 -0700 Subject: [PATCH] Updates for 0.11.1 (#56) * Updates for 0.11 * Fix the build * 0.11.1 --- bower.json | 16 ++++++++-------- package.json | 8 ++++---- src/Data/Lens/Fold.purs | 2 +- src/Data/Lens/Iso.purs | 18 ++++++++++++++---- src/Data/Lens/Iso/Newtype.purs | 2 +- src/Data/Lens/Setter.purs | 14 +++++++------- 6 files changed, 35 insertions(+), 25 deletions(-) diff --git a/bower.json b/bower.json index 307c628..4ba357d 100644 --- a/bower.json +++ b/bower.json @@ -12,15 +12,15 @@ "url": "git://github.com/purescript-contrib/purescript-profunctor-lenses.git" }, "dependencies": { - "purescript-const": "^2.0.0", - "purescript-functors": "^1.0.0", - "purescript-identity": "^2.0.0", - "purescript-profunctor": "^2.0.0", - "purescript-sets": "^2.0.0", - "purescript-unsafe-coerce": "^2.0.0", - "purescript-transformers": "^2.0.1" + "purescript-const": "^3.0.0", + "purescript-functors": "^2.0.0", + "purescript-identity": "^3.0.0", + "purescript-profunctor": "^3.0.0", + "purescript-sets": "^3.0.0", + "purescript-unsafe-coerce": "^3.0.0", + "purescript-transformers": "^3.0.0" }, "devDependencies": { - "purescript-console": "^2.0.0" + "purescript-console": "^3.0.0" } } diff --git a/package.json b/package.json index b718f0e..da76be2 100644 --- a/package.json +++ b/package.json @@ -2,13 +2,13 @@ "private": true, "scripts": { "clean": "rimraf output && rimraf .pulp-cache", - "build": "pulp build --censor-lib --strict", + "build": "pulp build -- --censor-lib --strict", "test": "pulp test" }, "devDependencies": { - "pulp": "^9.0.1", - "purescript-psa": "^0.3.9", - "purescript": "^0.10.1", + "pulp": "^11.0.0", + "purescript-psa": "^0.5.0", + "purescript": "^0.11.1", "rimraf": "^2.5.4" } } diff --git a/src/Data/Lens/Fold.purs b/src/Data/Lens/Fold.purs index 354be2e..ca92732 100644 --- a/src/Data/Lens/Fold.purs +++ b/src/Data/Lens/Fold.purs @@ -173,7 +173,7 @@ replicated i (Forget a) = Forget (go i a) go n x = x <> go (n - 1) x -- | Folds over a `Foldable` container. -folded :: forall g a b t r. (Monoid r, Foldable g) => Fold r (g a) b a t +folded :: forall g a b t r. Monoid r => Foldable g => Fold r (g a) b a t folded (Forget a) = Forget (foldMap a) -- | Builds a `Fold` using an unfold. diff --git a/src/Data/Lens/Iso.purs b/src/Data/Lens/Iso.purs index 418df2d..1be9a0d 100644 --- a/src/Data/Lens/Iso.purs +++ b/src/Data/Lens/Iso.purs @@ -37,7 +37,7 @@ auf l = withIso l \sa bt f g e -> bt (f (rmap sa g) e) under :: forall s t a b. AnIso s t a b -> (t -> s) -> b -> a under l = withIso l \sa bt ts -> sa <<< ts <<< bt --- | If `a1` is obtained from `a` by removing a single value, then +-- | If `a1` is obtained from `a` by removing a single value, then -- | `Maybe a1` is isomorphic to `a`. non :: forall a. Eq a => a -> Iso' (Maybe a) a non def = iso (fromMaybe def) g @@ -53,9 +53,19 @@ uncurried = iso uncurry curry flipped :: forall a b c d e f. Iso (a -> b -> c) (d -> e -> f) (b -> a -> c) (e -> d -> f) flipped = iso flip flip -mapping :: forall s t a b f g. (Functor f, Functor g) => AnIso s t a b -> Iso (f s) (g t) (f a) (g b) +mapping + :: forall s t a b f g + . Functor f + => Functor g + => AnIso s t a b + -> Iso (f s) (g t) (f a) (g b) mapping l = withIso l \sa bt -> iso (map sa) (map bt) -dimapping :: forall s ss t tt a aa b bb p q - . (Profunctor p, Profunctor q) => AnIso s t a b -> AnIso ss tt aa bb -> Iso (p a ss) (q b tt) (p s aa) (q t bb) +dimapping + :: forall s ss t tt a aa b bb p q + . Profunctor p + => Profunctor q + => AnIso s t a b + -> AnIso ss tt aa bb + -> Iso (p a ss) (q b tt) (p s aa) (q t bb) dimapping f g = withIso f \sa bt -> withIso g \ssaa bbtt -> iso (dimap sa ssaa) (dimap bt bbtt) diff --git a/src/Data/Lens/Iso/Newtype.purs b/src/Data/Lens/Iso/Newtype.purs index 2acba6f..b25d5f7 100644 --- a/src/Data/Lens/Iso/Newtype.purs +++ b/src/Data/Lens/Iso/Newtype.purs @@ -3,5 +3,5 @@ module Data.Lens.Iso.Newtype where import Data.Lens.Iso (Iso, iso) import Data.Newtype (class Newtype, wrap, unwrap) -_Newtype :: forall t a s b. (Newtype t a, Newtype s b) => Iso t s a b +_Newtype :: forall t a s b. Newtype t a => Newtype s b => Iso t s a b _Newtype = iso unwrap wrap diff --git a/src/Data/Lens/Setter.purs b/src/Data/Lens/Setter.purs index c11c21b..fd77cae 100644 --- a/src/Data/Lens/Setter.purs +++ b/src/Data/Lens/Setter.purs @@ -103,25 +103,25 @@ assign p b = modify (set p b) modifying :: forall s a b m. MonadState s m => Setter s s a b -> (a -> b) -> m Unit modifying p f = modify (over p f) -addModifying :: forall s a m. (MonadState s m, Semiring a) => Setter' s a -> a -> m Unit +addModifying :: forall s a m. MonadState s m => Semiring a => Setter' s a -> a -> m Unit addModifying p = modifying p <<< add -mulModifying :: forall s a m. (MonadState s m, Semiring a) => Setter' s a -> a -> m Unit +mulModifying :: forall s a m. MonadState s m => Semiring a => Setter' s a -> a -> m Unit mulModifying p = modifying p <<< flip mul -subModifying :: forall s a m. (MonadState s m, Ring a) => Setter' s a -> a -> m Unit +subModifying :: forall s a m. MonadState s m => Ring a => Setter' s a -> a -> m Unit subModifying p = modifying p <<< flip sub -divModifying :: forall s a m. (MonadState s m, EuclideanRing a) => Setter' s a -> a -> m Unit +divModifying :: forall s a m. MonadState s m => EuclideanRing a => Setter' s a -> a -> m Unit divModifying p = modifying p <<< flip div -disjModifying :: forall s a m. (MonadState s m, HeytingAlgebra a) => Setter' s a -> a -> m Unit +disjModifying :: forall s a m. MonadState s m => HeytingAlgebra a => Setter' s a -> a -> m Unit disjModifying p = modifying p <<< flip disj -conjModifying :: forall s a m. (MonadState s m, HeytingAlgebra a) => Setter' s a -> a -> m Unit +conjModifying :: forall s a m. MonadState s m => HeytingAlgebra a => Setter' s a -> a -> m Unit conjModifying p = modifying p <<< flip conj -appendModifying :: forall s a m. (MonadState s m, Semigroup a) => Setter' s a -> a -> m Unit +appendModifying :: forall s a m. MonadState s m => Semigroup a => Setter' s a -> a -> m Unit appendModifying p = modifying p <<< flip append assignJust :: forall s a b m. MonadState s m => Setter s s a (Maybe b) -> b -> m Unit