packages feed

basic-lens 0.0.1 → 0.0.2

raw patch · 2 files changed

+8/−10 lines, 2 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ Control.Lens.Basic: field :: Name -> Q Exp

Files

basic-lens.cabal view
@@ -1,5 +1,5 @@ name:                basic-lens-version:             0.0.1+version:             0.0.2 synopsis:            Basic lens type and functions description:         Necessary type and functions for basic lens work.                      .
src/Control/Lens/Basic.hs view
@@ -12,7 +12,8 @@    -- * Functions   ,view   ,set-  ,over)+  ,over+  ,field)   where  import Control.Applicative@@ -42,14 +43,11 @@ -- __Example__ -- -- @--- λ> data Person = Person Char Int deriving Show--- λ> let _age f (Person x a) = fmap (\\b -> Person x b) (f a)--- λ> view _age (Person 'a' 10)--- 10--- λ> over _age (+1) (Person 'a' 10)--- Person 'a' 11--- λ> set _age 100 (Person 'a' 10)--- Person 'a' 100+-- λ> data Person = Person { personChar :: Char, personAge :: Int } deriving Show+-- λ> view $(field 'personChar) (Person 'a' 10)+-- 'a'+-- λ> over $(field 'personAge) (*2) (Person 'a' 10)+-- Person {personChar = 'a', personAge = 20} -- λ> -- @ --