|
Yes, the colon ( For example, in
you probably can't avoid declaring a:char. Notice that ML infers from this that b is also a char, so you don't need to type both of the arguments. The reason that you need to declare a type for one of them is that < is an overloaded symbol, working on integers, characters, and some other types as well.
Similarly, in
it's really the use of < later on in the definition that requires disambiguation, but I like to put my type information as early as possible in a definition (I'm not sure why). You could make a good argument for always putting type information as close as possible to the place where it's needed.
Mike O'D. |
to: