profunctor-optics 0.0.0.3 → 0.0.0.4
raw patch · 5 files changed
+26/−25 lines, 5 filesdep ~profunctorsdep ~transformersPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: profunctors, transformers
API changes (from Hackage documentation)
- Data.Profunctor.Optic.Affine: is :: AAffine s t a b -> s -> Bool
- Data.Profunctor.Optic.Affine: isnt :: AAffine s t a b -> s -> Bool
+ Data.Profunctor.Optic.Option: is :: AOption a s a -> s -> Bool
+ Data.Profunctor.Optic.Option: isnt :: AOption a s a -> s -> Bool
- Data.Profunctor.Optic.Prelude: is :: AAffine s t a b -> s -> Bool
+ Data.Profunctor.Optic.Prelude: is :: AOption a s a -> s -> Bool
- Data.Profunctor.Optic.Prelude: isnt :: AAffine s t a b -> s -> Bool
+ Data.Profunctor.Optic.Prelude: isnt :: AOption a s a -> s -> Bool
Files
- profunctor-optics.cabal +3/−3
- src/Data/Profunctor/Optic.hs +0/−1
- src/Data/Profunctor/Optic/Affine.hs +0/−20
- src/Data/Profunctor/Optic/Option.hs +21/−1
- src/Data/Profunctor/Optic/Types.hs +2/−0
profunctor-optics.cabal view
@@ -1,7 +1,7 @@ cabal-version: >= 1.10 name: profunctor-optics-version: 0.0.0.3+version: 0.0.0.4 synopsis: An optics library compatible with the typeclasses in 'profunctors'. description: This package provides utilities for creating and manipulating profunctor-based optics. Some highlights:@@ -100,11 +100,11 @@ , mtl >= 2.0.1 && < 2.3 , newtype-generics >= 0.5.3 && < 0.6 , profunctor-arrows >= 0.0.0.2 && < 0.0.1- , profunctors >= 5.3 && < 6+ , profunctors >= 5.4 && < 6 , rings >= 0.0.2.1 && < 0.1 , semigroupoids >= 5 && < 6 , tagged >= 0.4.4 && < 1- , transformers >= 0.5.6.0 && < 0.6+ , transformers >= 0.5 && < 0.6 , unliftio-core >= 0.1.2 && < 0.2 , adjunctions >= 4.4 && < 5.0
src/Data/Profunctor/Optic.hs view
@@ -23,7 +23,6 @@ , module View , module Setter , module Zoom- , module Data.Profunctor.Optic ) where import Data.Profunctor.Optic.Types as Type
src/Data/Profunctor/Optic/Affine.hs view
@@ -23,8 +23,6 @@ -- * Primitive operators , withAffine -- * Operators- , is- , isnt , matches -- * Classes , Strong(..)@@ -128,24 +126,6 @@ --------------------------------------------------------------------- -- Operators ------------------------------------------------------------------------- | Check whether the optic is matched.------ >>> is just Nothing--- False----is :: AAffine s t a b -> s -> Bool-is o = either (const False) (const True) . matches o-{-# INLINE is #-}---- | Check whether the optic isn't matched.------ >>> isnt just Nothing--- True----isnt :: AAffine s t a b -> s -> Bool-isnt o = either (const True) (const False) . matches o-{-# INLINE isnt #-} -- | Test whether the optic matches or not. --
src/Data/Profunctor/Optic/Option.hs view
@@ -23,6 +23,8 @@ , (^?) , preview , preuse+ , is+ , isnt -- * Indexed operators , ipreview , ipreviews@@ -44,7 +46,7 @@ import Data.Profunctor.Optic.Carrier import Data.Profunctor.Optic.Import import Data.Profunctor.Optic.Prism (just, async)-import Data.Profunctor.Optic.Affine (affineVl, iaffineVl, is)+import Data.Profunctor.Optic.Affine import Data.Profunctor.Optic.Types import Data.Profunctor.Optic.View import qualified Control.Exception as Ex@@ -183,6 +185,24 @@ preuse :: MonadState s m => AOption a s a -> m (Maybe a) preuse o = State.gets $ preview o {-# INLINE preuse #-}++-- | Check whether the optic is matched.+--+-- >>> is just Nothing+-- False+--+is :: AOption a s a -> s -> Bool+is o s = isJust (preview o s)+{-# INLINE is #-}++-- | Check whether the optic isn't matched.+--+-- >>> isnt just Nothing+-- True+--+isnt :: AOption a s a -> s -> Bool+isnt o s = not (isJust (preview o s))+{-# INLINE isnt #-} ------------------------------------------------------------------------------ -- Indexed operators
src/Data/Profunctor/Optic/Types.hs view
@@ -351,8 +351,10 @@ instance (Coapplicative f, Coapplicative g) => Coapplicative (Compose f g) where copure (Compose a) = copure . fmap copure $ a +#if MIN_VERSION_profunctors(5,4,0) instance Coapplicative f => Choice (Costar f) where left' (Costar f) = Costar $ either (Left . f) (Right . copure) . branch+#endif -- | Can be used to rewrite --