lens-family 2.0.0 → 2.1.0
raw patch · 3 files changed
+69/−23 lines, 3 filesdep ~lens-family-corePVP ok
version bump matches the API change (PVP)
Dependency ranges changed: lens-family-core
API changes (from Hackage documentation)
+ Lens.Family2.Stock: just :: Prism (Maybe a) (Maybe b) a b
+ Lens.Family2.Stock: just_ :: Traversal (Maybe a) (Maybe b) a b
+ Lens.Family2.Stock: left :: Prism (Either a r) (Either b r) a b
+ Lens.Family2.Stock: left_ :: Traversal (Either a r) (Either b r) a b
+ Lens.Family2.Stock: nothing :: Prism' (Maybe a) ()
+ Lens.Family2.Stock: nothing_ :: Traversal' (Maybe a) ()
+ Lens.Family2.Stock: right :: Prism (Either r a) (Either r b) a b
+ Lens.Family2.Stock: right_ :: Traversal (Either r a) (Either r b) a b
Files
- CHANGELOG +10/−0
- lens-family.cabal +2/−2
- src/Lens/Family2/Stock.hs +57/−21
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.cabal view
@@ -1,6 +1,6 @@ name: lens-family category: Data, Lenses-version: 2.0.0+version: 2.1.0 license: BSD3 cabal-version: >= 1.6 license-file: LICENSE@@ -46,7 +46,7 @@ containers >= 0.5.8 && < 0.7, transformers >= 0.3.0 && < 0.6, mtl >= 2.2 && < 2.3,- lens-family-core >= 2.0.0 && < 2.1+ lens-family-core >= 2.1.0 && < 2.2 exposed-modules: Lens.Family2.Unchecked
src/Lens/Family2/Stock.hs view
@@ -13,8 +13,8 @@ , at', intAt' , contains, intContains -- * Stock Prisms- , lft, rgt- , some, none+ , left, right+ , just, nothing -- * Stock Grids , both , bend, lend@@ -25,8 +25,8 @@ -- * Stock Traversals , both_ , bend_, lend_- , lft_, rgt_- , some_, none_+ , left_, right_+ , just_, nothing_ , ignored -- * Stock SECs , mapped@@ -48,6 +48,11 @@ , Stock.LensLike, Stock.LensLike' , Stock.Identical, Stock.Backwards , Stock.FiniteBits+-- * Deprecated names+ , lft, rgt+ , some, none+ , lft_, rgt_+ , some_, none_ ) where import qualified Data.Map as Map@@ -102,37 +107,36 @@ cod = Stock.cod -- | A prism on the 'Left' element of an 'Either'.-lft :: Prism (Either a r) (Either b r) a b-lft = Stock.lft+left :: Prism (Either a r) (Either b r) a b+left = Stock.left -- | Traversal on the 'Left' element of an 'Either'.-lft_ :: Traversal (Either a r) (Either b r) a b-lft_ = Stock.lft_+left_ :: Traversal (Either a r) (Either b r) a b+left_ = Stock.left_ -- | A prism on the 'Right' element of an 'Either'.-rgt :: Prism (Either r a) (Either r b) a b-rgt = Stock.rgt+right :: Prism (Either r a) (Either r b) a b+right = Stock.right -- | Traversal on the 'Right' element of an 'Either'.-rgt_ :: Traversal (Either r a) (Either r b) a b-rgt_ = Stock.rgt_-+right_ :: Traversal (Either r a) (Either r b) a b+right_ = Stock.right_ -- | A prism on the 'Just' element of a 'Maybe'.-some :: Prism (Maybe a) (Maybe b) a b-some = Stock.some+just :: Prism (Maybe a) (Maybe b) a b+just = Stock.just -- | Traversal on the 'Just' element of a 'Maybe'.-some_ :: Traversal (Maybe a) (Maybe b) a b-some_ = Stock.some_+just_ :: Traversal (Maybe a) (Maybe b) a b+just_ = Stock.just_ -- | A prism on the 'Nothing' element of a 'Maybe'.-none :: Prism' (Maybe a) ()-none = Stock.none+nothing :: Prism' (Maybe a) ()+nothing = Stock.nothing -- | Traversal on the 'Nothing' element of a 'Maybe'.-none_ :: Traversal' (Maybe a) ()-none_ = Stock.none_+nothing_ :: Traversal' (Maybe a) ()+nothing_ = Stock.nothing_ -- | A grid on both elements of a pair @(a,a)@. both :: Grid (a,a) (b,b) a b@@ -189,3 +193,35 @@ -- | An SEC referencing the parameter of a functor. mapped :: Functor f => Setter (f a) (f a') a a' mapped = Stock.mapped++{-# DEPRECATED lft "Renamed as 'left'." #-}+lft :: Prism (Either a r) (Either b r) a b+lft = left++{-# DEPRECATED lft_ "Renamed as 'left_'." #-}+lft_ :: Traversal (Either a r) (Either b r) a b+lft_ = left_++{-# DEPRECATED rgt "Renamed as 'right'." #-}+rgt :: Prism (Either r a) (Either r b) a b+rgt = right++{-# DEPRECATED rgt_ "Renamed as 'right_'." #-}+rgt_ :: Traversal (Either r a) (Either r b) a b+rgt_ = right_++{-# DEPRECATED some "Renamed as 'just'." #-}+some :: Prism (Maybe a) (Maybe b) a b+some = just++{-# DEPRECATED some_ "Renamed as 'just_'." #-}+some_ :: Traversal (Maybe a) (Maybe b) a b+some_ = just_++{-# DEPRECATED none "Renamed as 'nothing'." #-}+none :: Prism' (Maybe a) ()+none = nothing++{-# DEPRECATED none_ "Renamed as 'nothing_'." #-}+none_ :: Traversal' (Maybe a) ()+none_ = nothing_