summaryrefslogtreecommitdiff
path: root/functor/h3.hs
blob: 1a048f6f3fc1d07eab19104c54cf7574cca55a61 (plain)
1
2
3
4
5
6
data ITree a = 
    Leaf (Int -> a) | Node [ITree a]

instance Functor ITree where
    fmap f (Node x) = Node (fmap (fmap f) x)
    fmap f (Leaf x) = Leaf (f.x)