Regarding the anonymous functions,
fun implies x y = (not x) orelse y
can be written as
val implies = fn x => fn y => (not x) orelse y
however as you see, it doesn't really make any sense to do it this way (in this particular case).
Anonymous functions in SML only take one argument. Currying of arguments works because the fun
keyword is syntactic sugar (also called a derived form) of
val rec implies = fn x => fn y =>
case (x, y) of
(x,y) => (not x) orelse y
The case is used because we could have had some pattern matching in the original function, which is then translated directly down into the case, and the rec
is because the original function might have been recursive.
Thus the second example @pad gave is equivalent to:
val rec implies = fn x => fn y =>
case (x, y) of
(false, false) => true
| (false, true) => true
| (true, false) => false
| (true, true) => true