Advertisement
Guest User

Untitled

a guest
May 24th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- Deliberately monomorphic: assume no Traversable instance for subtrees
  2. data IntTree = Leaf Int | Branch IntTree IntTree
  3.  
  4. children :: Traversal' IntTree IntTree
  5. leaves :: Traversal' InTTree Int
  6.  
  7. allLeaves :: Traversal' IntTree Int
  8. allLeaves = leaves ??? (children . allLeaves)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement