Next Atypical Types 56

Type Inference

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

"h must have type a."

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

"f is used as a function applied to h."

"So f must have type a -> b for some b."

"f must take an argument of type a and return a result of type b."

Next Copyright © 1999,2008 Mark Dominus