[MLton] Unicode / WideChar

Stephen Weeks MLton@mlton.org
Tue, 22 Nov 2005 09:39:45 -0800


> I think that it (chosing between exception/default-to-identity
> vs. raising an exception/returning an option) is all matter of
> convenience for the `usual' case.  The argument for toUpper being
> extended to the identity is that often one wants to do that to
> strings (for case-insensitive comparisons for example).  Clearly one
> can emulate either behavior from the other (at least with isAlpha),
> so it really is just a matter of elegance and expediency.

I don't get it.  Raising an exception is equivalent to returning an
option, in that each can easily implement the other.  And either of
those can implement default-to-identity.  But there is no way to
implement them from default-to-identity.  That's why the exception or
option is preferable.  Or am I confused?