RosettaCodeData/Task/Parametric-polymorphism/Clean/parametric-polymorphism-2.clean

4 lines
119 B
Text
Raw Permalink Normal View History

2013-04-10 23:57:08 -07:00
instance Functor Tree where
fmap f Empty = Empty
fmap f (Node x l r) = Node (f x) (fmap f l) (fmap f r)