packages feed

lens-family-core 2.0.0 → 2.1.0

raw patch · 3 files changed

+78/−31 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ Lens.Family.Stock: just :: (Applicative f, Traversable g) => AdapterLike f g (Maybe a) (Maybe b) a b
+ Lens.Family.Stock: just_ :: Applicative f => LensLike f (Maybe a) (Maybe b) a b
+ Lens.Family.Stock: left :: (Applicative f, Traversable g) => AdapterLike f g (Either a r) (Either b r) a b
+ Lens.Family.Stock: left_ :: Applicative f => LensLike f (Either a r) (Either b r) a b
+ Lens.Family.Stock: nothing :: (Applicative f, Traversable g) => AdapterLike' f g (Maybe a) ()
+ Lens.Family.Stock: nothing_ :: Applicative f => LensLike' f (Maybe a) ()
+ Lens.Family.Stock: right :: (Applicative f, Traversable g) => AdapterLike f g (Either r a) (Either r b) a b
+ Lens.Family.Stock: right_ :: Applicative f => LensLike f (Either r a) (Either r b) a b

Files

CHANGELOG view
@@ -1,3 +1,13 @@+2.1.0 (Changes from 2.0.0)+==========================+This release makes some minor name changes to functions.++* 'lft' and 'rgt' have been renamed as 'left' and 'right'.+* 'some' and 'none' have been renamed as 'just' and 'nothing'.+* Similar name changes for the lens variants of the above prisms.++The old names are depricated and may be removed in the future.+ 2.0.0 (Changes from 1.2.4) ========================== This new release continues to explore the design of Van Laarhoven style
lens-family-core.cabal view
@@ -1,6 +1,6 @@ name:               lens-family-core category:           Data, Lenses-version:            2.0.0+version:            2.1.0 license:            BSD3 cabal-version:      >= 1.6 license-file:       LICENSE
src/Lens/Family/Stock.hs view
@@ -12,8 +12,8 @@   , at', intAt'   , contains, intContains -- * Stock Prisms-  , lft, rgt-  , some, none+  , left, right+  , just, nothing -- * Stock Grids   , both   , bend, lend@@ -24,8 +24,8 @@ -- * Stock Traversals   , both_   , bend_, lend_-  , lft_, rgt_-  , some_, none_+  , left_, right_+  , just_, nothing_   , ignored -- * Stock SECs   , mapped@@ -44,6 +44,11 @@   , GrateLike, GrateLike'   , Identical, Backwards   , FiniteBits+-- * Deprecated names+  , lft, rgt+  , some, none+  , lft_, rgt_+  , some_, none_   ) where  import Control.Arrow (first, second)@@ -174,79 +179,79 @@ -- A grate accessing the codomain of a function. cod f h r = f $ ($ r) <$> h -lft :: (Applicative f, Traversable g) => AdapterLike f g (Either a r) (Either b r) a b+left :: (Applicative f, Traversable g) => AdapterLike f g (Either a r) (Either b r) a b -- ^ @--- lft :: Prism (Either a r) (Either b r) a b+-- left :: Prism (Either a r) (Either b r) a b -- @ -- -- A prism on the 'Left' element of an 'Either'.-lft f = either (pure . Right) (fmap Left . f) . traverse switch+left f = either (pure . Right) (fmap Left . f) . traverse switch  where   switch = either Right Left -lft_ :: Applicative f => LensLike f (Either a r) (Either b r) a b+left_ :: Applicative f => LensLike f (Either a r) (Either b r) a b -- ^ @--- lft_ :: Traversal (Either a r) (Either b r) a b+-- left_ :: Traversal (Either a r) (Either b r) a b -- @ -- -- Traversal on the 'Left' element of an 'Either'. -- -- @--- lft_ = under lft+-- left_ = under left -- @-lft_ = under lft+left_ = under left -rgt :: (Applicative f, Traversable g) => AdapterLike f g (Either r a) (Either r b) a b+right :: (Applicative f, Traversable g) => AdapterLike f g (Either r a) (Either r b) a b -- ^ @--- rgt :: Prism (Either r a) (Either r b) a b+-- right :: Prism (Either r a) (Either r b) a b -- @ -- -- A prism on the 'Right' element of an 'Either'.-rgt f = either (pure . Left) (fmap Right . f) . sequenceA+right f = either (pure . Left) (fmap Right . f) . sequenceA -rgt_ :: Applicative f => LensLike f (Either r a) (Either r b) a b+right_ :: Applicative f => LensLike f (Either r a) (Either r b) a b -- ^ @--- rgt_ :: Traversal (Either r a) (Either r b) a b+-- right_ :: Traversal (Either r a) (Either r b) a b -- @ -- -- Traversal on the 'Right' element of an 'Either'. -- -- @--- rgt_ = under rgt+-- right_ = under right -- @-rgt_ = under rgt+right_ = under right -some :: (Applicative f, Traversable g) => AdapterLike f g (Maybe a) (Maybe b) a b+just :: (Applicative f, Traversable g) => AdapterLike f g (Maybe a) (Maybe b) a b -- ^ @--- some :: Prism (Maybe a) (Maybe b) a b+-- just :: Prism (Maybe a) (Maybe b) a b -- @ -- -- A prism on the 'Just' element of a 'Maybe'.-some f = maybe (pure Nothing) (fmap Just . f) . sequenceA+just f = maybe (pure Nothing) (fmap Just . f) . sequenceA -some_ :: Applicative f => LensLike f (Maybe a) (Maybe b) a b+just_ :: Applicative f => LensLike f (Maybe a) (Maybe b) a b -- ^ @--- some_ :: Traversal (Maybe a) (Maybe b) a b+-- just_ :: Traversal (Maybe a) (Maybe b) a b -- @ -- -- Traversal on the 'Just' element of a 'Maybe'.-some_ = under some+just_ = under just -none :: (Applicative f, Traversable g) => AdapterLike' f g (Maybe a) ()+nothing :: (Applicative f, Traversable g) => AdapterLike' f g (Maybe a) () -- ^ @--- none :: Prism' (Maybe a) ()+-- nothing :: Prism' (Maybe a) () -- @ -- -- A prism on the 'Nothing' element of a 'Maybe'.-none = prism (maybe (Right ()) (Left . Just)) (const Nothing)+nothing = prism (maybe (Right ()) (Left . Just)) (const Nothing) -none_ :: Applicative f => LensLike' f (Maybe a) ()+nothing_ :: Applicative f => LensLike' f (Maybe a) () -- ^ @--- none_ :: Traversal' (Maybe a) ()+-- nothing_ :: Traversal' (Maybe a) () -- @ -- -- Traversal on the 'Nothing' element of a 'Maybe'.-none_ = under none+nothing_ = under nothing  both :: (Applicative f, Functor g) => AdapterLike f g (a,a) (b,b) a b -- ^ @@@ -503,3 +508,35 @@ from l = l'  where   FromF l' = l (\(FromG h1) -> FromF $ (.) h1) (FromG id)++{-# DEPRECATED lft "Renamed as 'left'." #-}+lft :: (Applicative f, Traversable g) => AdapterLike f g (Either a r) (Either b r) a b+lft = left++{-# DEPRECATED lft_ "Renamed as 'left_'." #-}+lft_ :: Applicative f => LensLike f (Either a r) (Either b r) a b+lft_ = left_++{-# DEPRECATED rgt "Renamed as 'right'." #-}+rgt :: (Applicative f, Traversable g) => AdapterLike f g (Either r a) (Either r b) a b+rgt = right++{-# DEPRECATED rgt_ "Renamed as 'right_'." #-}+rgt_ :: Applicative f => LensLike f (Either r a) (Either r b) a b+rgt_ = right_++{-# DEPRECATED some "Renamed as 'just'." #-}+some :: (Applicative f, Traversable g) => AdapterLike f g (Maybe a) (Maybe b) a b+some = just++{-# DEPRECATED some_ "Renamed as 'just_'." #-}+some_ :: Applicative f => LensLike f (Maybe a) (Maybe b) a b+some_ = just_++{-# DEPRECATED none "Renamed as 'nothing'." #-}+none :: (Applicative f, Traversable g) => AdapterLike' f g (Maybe a) ()+none = nothing++{-# DEPRECATED none_ "Renamed as 'nothing_'." #-}+none_ :: Applicative f => LensLike' f (Maybe a) ()+none_ = nothing_