[Haskell-cafe] How to compare PortNumbers or Bug in Network.Socket?

Bryan O'Sullivan bos at serpentine.com
Thu Mar 12 17:56:55 EDT 2009


On Thu, Mar 12, 2009 at 2:44 PM, Stefan Schmidt <
stefanschmidt42 at googlemail.com> wrote:

> As a work around, I could convert two PortNumbers back to Int-Values before
> comparing them, but I think the ordering functions for the PortNumber-Type
> do not work as expected. Or am I wrong?
>

You're right. Arguably the port numbers shouldn't have their endianness
switched until the need actually arises (passed into bind or the like).

However, it's also arguably the case that you shouldn't care about port
number ordering. That smells dodgy to me.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20090312/e97d3e7a/attachment.htm


More information about the Haskell-Cafe mailing list