Next Atypical Types 55

Type Inference

map ::(p, [a]) -> q
f ::p

"[] has some list type, say [a]."

        map(f, []) = []
        map(f, h:t) = f(h) : map(f, t)

"h must have type a and t must have type [a]."

Next Copyright © 1999,2008 Mark Dominus