Alg. Datentypen (Beispiele)

data Bool = False | True
data Maybe a = Nothing | Just a

data Tree a = 
    Leaf | Branch ( Tree a ) a ( Tree a)
Ü: inorder, preorder, leaves, depth

Ü: Schlüssel in Blättern

data N = Z | S N
Ü: Rechenoperationen


Notation für Listen in Haskell:

anstatt data List a = Nil | Cons a (List a)

wird benutzt data [a] = [] | (a : [a])



Johannes Waldmann 2013-02-01