Anwendung I: Generierung von Bäumen

data Tree a = Leaf
          | Branch { left :: Tree a
                   , key :: a 
                   , right :: Tree a }

instance Serial a => Serial ( Tree a ) where
    series = cons0 Leaf \/ cons3 Branch



Johannes Waldmann 2011-01-18