Skip to content

Commit

Permalink
Updates for 0.11.1 (#56)
Browse files Browse the repository at this point in the history
* Updates for 0.11

* Fix the build

* 0.11.1
  • Loading branch information
paf31 authored Apr 2, 2017
1 parent cb6be8d commit e9330dc
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 25 deletions.
16 changes: 8 additions & 8 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
2 changes: 1 addition & 1 deletion src/Data/Lens/Fold.purs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
18 changes: 14 additions & 4 deletions src/Data/Lens/Iso.purs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
2 changes: 1 addition & 1 deletion src/Data/Lens/Iso/Newtype.purs
Original file line number Diff line number Diff line change
Expand Up @@ -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
14 changes: 7 additions & 7 deletions src/Data/Lens/Setter.purs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e9330dc

Please sign in to comment.