RE: Should inet_ntoa Be Pure?

On 07 May 2005 11:59, Dominic Steinitz wrote:
Does anyone know why these are in the IO monad? Aren't they pure functions converting between dotted-decimal strings and a 32-bit network byte ordered binary value?
Dominic.
http://www.haskell.org/ghc/docs/latest/html/libraries/network/Network.So cket.html#v%3Ainet_addr
http://www.haskell.org/ghc/docs/latest/html/libraries/network/Network.So cket.html#v%3Ainet_ntoa Clearly it should be pure. To avoid breaking the interface, we could add: showHostAddress :: HostAddress -> String and deprecate inet_ntoa? Cheers, Simon

http://www.haskell.org/ghc/docs/latest/html/libraries/network/Network.So cket.html#v%3Ainet_addr
http://www.haskell.org/ghc/docs/latest/html/libraries/network/Network.So cket.html#v%3Ainet_ntoa
What is with this wrapping? Sorry to cross-post this, but I couldn't figure out what to cut out...
participants (2)
-
Samuel Bronson
-
Simon Marlow