September 22, 1999 Strong Typing Slide #23

Type Elaboration Example 4

        fun map(f, [])     = []
          | map(f,(h::t))  = f(h)::(map(f, t));

Compiler says to itself:

Compiler says:

        val map = fn : ('a -> 'b) * 'a list -> 'b list


Next Copyright © 1999 M-J. Dominus