Wiederholung Listen

Bezeichnungen bisher:
data List a  = Nil | Cons a (List a)
     Nil  :: List a
     Cons :: a -> List a -> List a
in Haskell-Prelude schon vordefiniert:
data     [a] = []  |      a : [a]
Anwendung:
import Prelude hiding ( length )
length :: [a] -> Int
length l = case l of
    []     -> 0
    x : xs -> 1 + length xs



2009-06-15