Created
January 23, 2017 14:28
-
-
Save esad/65b6c29c074c53b89901e7f32c33adca 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
type ItemRef = Int | |
newtype Item = Item | |
{ text :: String | |
, done :: Boolean | |
, ref :: ItemRef | |
} | |
derive instance newtypeItem :: Newtype Item _ | |
newtype Model = Model | |
{ items :: M.Map ItemRef Item | |
, selection :: Maybe ItemRef | |
, nextRef :: ItemRef | |
} | |
derive instance newtypeModel :: Newtype Model _ | |
_items :: forall a . Traversal' Model Item | |
_items = _Newtype <<< (lens _.items (_ { items = _})) <<< traversed |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment