Operationen auf Listen

length :: [a] -> Int
length l = case l of
    x : xs -> 1 + length xs
    []     -> 0
sum :: [Int] -> Int
sum l = case l of
    x : xs -> x + sum xs
    [] -> 0
f ::            -> 
f l = case l of
    x : xs -> g x (f xs)
    [] -> h
f durch Rekursionsschema mit Parametern g und h



2009-06-15