Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Foldable t
- where
- fold :: (a b -> b) b (t a) -> b
- instance Foldable []
- where
- fold :: (a b -> b) b [a] -> b
- fold op r l = foldr op r l
- instance Foldable Tree
- where
- fold :: (a b -> b) b (Tree a) -> b
- fold op r Empty = r
- fold op r (Node a b c) = fold op (fold op (op b r) a) c
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement