Discussion: Why is inet_addr in IO?

Edward Kmett ekmett at gmail.com
Thu Aug 28 14:41:23 UTC 2014


inet_addr doesn't do any lookups, it is basically a glorified parsing
problem converting from a string to a host address.

http://hackage.haskell.org/package/network-2.6.0.1/docs/src/Network-Socket.html#inet_addr

Why, beyond the obvious implementation details, does it live in IO?

Given that the current version lives in IO, should there be a version that
is obviously made pure so that folks who want to use it directly can do so
without having to bury it behind an unsafePerformIO?

This isn't a concrete proposal at this time, but more an attempt to sound
out if such a proposal should be formed.

-Edward
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/libraries/attachments/20140828/b31804c4/attachment.html>


More information about the Libraries mailing list