lens-tutorial 1.0.3 → 1.0.4
raw patch · 2 files changed
+9/−7 lines, 2 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Control.Lens.Tutorial: traverse :: Traversable t => forall (f :: * -> *) a b. Applicative f => (a -> f b) -> t a -> f (t b)
+ Control.Lens.Tutorial: traverse :: (Traversable t, Applicative f) => (a -> f b) -> t a -> f (t b)
Files
- lens-tutorial.cabal +1/−1
- src/Control/Lens/Tutorial.hs +8/−6
lens-tutorial.cabal view
@@ -1,5 +1,5 @@ Name: lens-tutorial-Version: 1.0.3+Version: 1.0.4 Cabal-Version: >=1.10 Build-Type: Simple License: BSD3
src/Control/Lens/Tutorial.hs view
@@ -65,6 +65,7 @@ import Control.Applicative (Applicative) import Control.Lens hiding (element)+import Control.Lens.TH import Data.Foldable (Foldable) import Data.Monoid (Monoid) @@ -94,13 +95,14 @@ -- > {-# LANGUAGE TemplateHaskell #-} -- > -- > import Control.Lens hiding (element)+-- > import Control.Lens.TH -- > -- > data Atom = Atom { _element :: String, _point :: Point } deriving (Show) -- > -- > data Point = Point { _x :: Double, _y :: Double } deriving (Show) -- >--- > makeLenses ''Atom--- > makeLenses ''Point+-- > $(makeLenses ''Atom)+-- > $(makeLenses ''Point) -- > -- > shiftAtomX :: Atom -> Atom -- > shiftAtomX = over (point . x) (+ 1)@@ -120,7 +122,7 @@ -- -- We could shift an entire @Molecule@ by writing: -- --- > makeLenses ''Molecule+-- > $(makeLenses ''Molecule) -- > -- > shiftMoleculeX :: Molecule -> Molecule -- > shiftMoleculeX = over (atoms . traverse . point . x) (+ 1)@@ -870,9 +872,9 @@ data Pair a = Pair a a deriving (Functor, Foldable, Traversable) -makeLenses ''Atom-makeLenses ''Point-makeLenses ''Molecule+$(makeLenses ''Atom)+$(makeLenses ''Point)+$(makeLenses ''Molecule) -- These purely exist to ensure that the examples still type-check. I don't -- export them, though, so that they won't conflict with the user's code.