semi-iso 0.4.0.0 → 0.4.1.0
raw patch · 3 files changed
+10/−1 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Control.Lens.SemiIso: alwaysFailing :: String -> SemiIso s t a b
+ Data.SemiIsoFunctor: sifail :: SemiIsoApply f => String -> f a
Files
- Control/Lens/SemiIso.hs +5/−0
- Data/SemiIsoFunctor.hs +4/−0
- semi-iso.cabal +1/−1
Control/Lens/SemiIso.hs view
@@ -63,6 +63,7 @@ constant, exact, bifiltered,+ alwaysFailing, -- * Semi-isos for numbers. _Negative,@@ -192,6 +193,10 @@ bifiltered p = semiIso check check where check x | p x = Right x | otherwise = Left "bifiltered: predicate failed"++-- | A semi-iso that fails in both directions.+alwaysFailing :: String -> SemiIso s t a b+alwaysFailing msg = semiIso (\_ -> Left msg) (\_ -> Left msg) -- | \-> Matches only negative numbers, turns it into a positive one. --
Data/SemiIsoFunctor.hs view
@@ -117,6 +117,10 @@ {-# MINIMAL (siunit | sipure), (/*/) #-} +-- | Fails with a message.+sifail :: SemiIsoApply f => String -> f a+sifail msg = alwaysFailing msg /$/ siunit+ -- | Equivalent of 'Alternative' for 'SemiIsoFunctor'. -- -- @f a@ should form a monoid with identity 'siempty' and binary
semi-iso.cabal view
@@ -1,5 +1,5 @@ name: semi-iso-version: 0.4.0.0+version: 0.4.1.0 synopsis: Weakened partial isomorphisms that work with lenses. description: Semi-isomorphisms are partial isomorphisms with weakened iso laws. And they work with Iso and Prism from @lens@!