Beispiel: Haskell2Xml

data Tree a = Leaf
            | Node { key :: a
                   , colour :: Colour
                   , left :: Tree a
                   , right :: Tree a
                   }
{-! for Tree derive: Haskell2Xml !-}
Präprozessor DrIFT erzeugt daraus Quelltext (Instanz für Interface)
class Haskell2Xml a where
    toXml   :: a -> Document
    fromXml :: Document -> a



Johannes Waldmann 2006-02-02