lens-family-th 0.5.0.1 → 0.5.0.2
raw patch · 5 files changed
+15/−71 lines, 5 filesdep +transformersdep −lens-familydep ~basedep ~template-haskellPVP ok
version bump matches the API change (PVP)
Dependencies added: transformers
Dependencies removed: lens-family
Dependency ranges changed: base, template-haskell
API changes (from Hackage documentation)
Files
- examples/test.lhs +0/−23
- examples/traversal-test.lhs +0/−23
- lens-family-th.cabal +6/−20
- stack.yaml +0/−4
- test/Test.hs +9/−1
− examples/test.lhs
@@ -1,23 +0,0 @@-To see the results of these ghci interactions on your own machine, run:-- [bash]- BlogLiterately -g examples/test.lhs > test.html && firefox test.html--> {-# LANGUAGE TemplateHaskell #-}--> import Lens.Family2-> import Lens.Family2.TH--> data Pair a b = Pair { _pairL :: a, _pairR :: b }-> deriving (Eq, Show, Read, Ord)-> $(makeLenses ''Pair)-- [ghci]- let p = Pair '1' 1 :: Pair Char Int- p ^. pairL- p ^. pairR- :m +Data.Char- (pairL %~ digitToInt) p- (pairR %~ intToDigit) p- (pairL .~ "foo") p- (pairR .~ "bar") p
− examples/traversal-test.lhs
@@ -1,23 +0,0 @@-To verify the results of these ghci interactions on your own machine, run:-- [bash]- BlogLiterately -g examples/traversal-test.lhs > test.html && firefox test.html--(Make sure you have the lens-family package installed.)--> {-# LANGUAGE TemplateHaskell #-}--> import Lens.Family2-> import Lens.Family2.TH--> data Opt b c d = A | B b | CD c d Int-> deriving (Eq, Show, Read, Ord)-> $(makeTraversals ''Opt)-- [ghci]- _B %~ (+1) $ A- A- _B %~ (+1) $ B 3- B 4- _B %~ (+1) $ CD 3 4 5- CD 3 4 5
lens-family-th.cabal view
@@ -1,20 +1,13 @@ name: lens-family-th-version: 0.5.0.1+version: 0.5.0.2 synopsis: Generate lens-family style lenses -description:- Due to a cabal/hackage defect, curly braces cannot be- adequately displayed here. Please see- <http://github.com/DanBurton/lens-family-th#readme>- for a proper description of this package.- .- (See <https://github.com/haskell/cabal/issues/968>- for the ticket I created regarding the defect.)+description: (see README.md) license: BSD3 license-file: LICENSE author: Dan Burton-copyright: (c) Dan Burton 2012-2017+copyright: (c) Dan Burton 2012-2018 homepage: http://github.com/DanBurton/lens-family-th#readme bug-reports: http://github.com/DanBurton/lens-family-th/issues@@ -25,16 +18,14 @@ cabal-version: >=1.8 extra-source-files: README.md- , stack.yaml- , examples/*.lhs library hs-source-dirs: src exposed-modules: Lens.Family.TH , Lens.Family2.TH , Lens.Family.THCore- build-depends: base >= 4.9 && < 4.11- , template-haskell >= 2.11 && < 2.13+ build-depends: base >= 4.9 && < 4.13+ , template-haskell >= 2.11 && < 2.15 test-suite lens-family-th-test type: exitcode-stdio-1.0@@ -42,15 +33,10 @@ main-is: Test.hs build-depends: base , hspec- , lens-family+ , transformers , lens-family-th , template-haskell source-repository head type: git location: git://github.com/DanBurton/lens-family-th.git--source-repository this- type: git- location: git://github.com/DanBurton/lens-family-th.git- tag: lens-family-th-0.5.0.1
− stack.yaml
@@ -1,4 +0,0 @@-# http://docs.haskellstack.org/en/stable/yaml_configuration/-resolver: nightly-2017-07-31-packages:-- '.'
test/Test.hs view
@@ -1,10 +1,18 @@ {-# LANGUAGE TemplateHaskell #-} import qualified Data.Char as Char-import Lens.Family2 ((^.), (%~), (.~)) import qualified Lens.Family2.TH as LFTH +import Data.Functor.Constant (Constant(..))+import Data.Functor.Identity (Identity(..)) import Test.Hspec (hspec, describe, it, shouldBe)+++-- operators copied from lens-family-core+x ^. l = getConstant $ l Constant x+l %~ f = runIdentity . l (Identity . f)+l .~ b = l %~ const b+ data Pair a b = Pair { _pairL :: a, _pairR :: b } deriving (Eq, Show, Read, Ord)