MLton.Socket improvement
Henry Cejtin
henry@sourcelight.com
Mon, 17 Dec 2001 18:30:20 -0600
Your telling me. It isn't as bad as in C, where the stdio.h file functions
are the only access to the convert-to-string functions, but it really is
a pain in the butt.
I have to go off to my brother's birthday in a few minutes, and will ponder
the right interface while there, but I'll do the quick change when I get back.
Note, their fancy use of phantom types does enforce some things, but not
others. In particular I had a bug in the first version of some code where
I called INetSock.Tcp.socket to make a socket, then Socket.bind to bind it
to the port I wanted but forgot to do a Socket.listen on it. The call to
Socket.accept was accepted by the compiler (but, of course, rejected by the
run time system). Given the complication of the types, and the fact that
it doesn't even catch this case, I wasn't impressed.