Last active
September 14, 2018 20:23
-
-
Save ddellacosta/22d3543daa099f41e25f77be8c681e3d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data A = A { _af :: B, _bs :: [Int] } deriving Show | |
data B = B { _bf :: Int, _bs1 :: Char } deriving Show | |
makeLenses ''A | |
makeLenses ''B | |
a = A (B 1 'a') [] | |
-- λ> (over bf (+1) . view af) a | |
-- B {_bf = 2, _bs1 = 'a'} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment