I've just started learning Standard ML (and functional programming in general) and I've come across two different ways of defining a function.
val double = fn x => x*2:
And
fun double x = x*2;
If I understand correctly, the first one is assigning a variable to an ananonymous function. Under what circumstances should I do this instead of fun abc
?