Vordefinierte Datentypen

bereits (so ähnlich) eingebaut:


data Bool = False |  True

data  [a]   = []
            | (:) { head :: a
                  , tail :: [a]
                  }

1 : (2 : (3 : (4 : []))) 
  = [1, 2, 3, 4] :: [ Int ]

Für xs /= [] gilt: head xs : tail xs = xs



Johannes Waldmann 2004-11-30