data List a = Nil | Cons a (List a) Nil :: List a Cons :: a -> List a -> List ain 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