[Haskell-cafe] Re: Coming up with a better API for Network.Socket.recv

Johan Tibell johan.tibell at gmail.com
Fri Feb 27 04:01:06 EST 2009

On Fri, Feb 27, 2009 at 12:07 AM, Achim Schneider <barsoap at web.de> wrote:
> "Bryan O'Sullivan" <bos at serpentine.com> wrote:
>> There's another problem with the network APIs: they mirror the BSD
>> socket API too faithfully, and provide insufficient type safety. You
>> can try to send on an unconnected socket, and to bind a socket that's
>> already connected, both of which should be statically forbidden. The
>> APIs for datagram-oriented networking ought to be distinct from the
>> stream-oriented variety, I think, even if the underlying C-level
>> calls end up being substantially the same.
> Iteratees to the rescue? Ideally, we'd have a composable IO system
> that's uniform across different types of IO.

I would very much like that. However, even after thinking about the
problem for several problems I don't know of a generic definition that
feels right. Hopefully someone smarter will come up with one.



More information about the Haskell-Cafe mailing list