Created
June 2, 2014 00:03
-
-
Save txrev319/229b2d8a0adf81c8d6c6 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 Doc = Doc { tag :: Node, order :: [Id], childs :: Map Id Doc } | |
doc__get_child :: Doc -> Id -> Doc | |
doc__get_child doc id = fromJust (Data.Map.lookup id (childs doc)) | |
doc__set_child :: Doc -> Id -> Doc -> Doc | |
doc__set_child doc id value = doc { childs = Data.Map.insert id value (childs doc) } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment