[Haskell-cafe] Bug in Network package

kudah kudahkukarek at gmail.com
Thu Apr 11 04:33:25 CEST 2013


There's actually a comment near the definition of PortNumber
http://hackage.haskell.org/packages/archive/network/latest/doc/html/src/Network-Socket-Types.html#PortNumber
>-- newtyped to prevent accidental use of sane-looking
>-- port numbers that haven't actually been converted to
>-- network-byte-order first.
Why the hell isn't it exported to haddocks is beyond me.

On Wed, 10 Apr 2013 16:51:23 -0400 Jeffrey Shaw <shawjef3 at gmail.com>
wrote:

> This is a case where a line of documentation could save a lot of
> people a lot of trouble. Anyone have a clone of network handy that
> they could make a pull request from?
> 
> Jeff
> 
> 
> On Wed, Apr 10, 2013 at 4:31 PM, Florian Hofmann <
> fhofmann at techfak.uni-bielefeld.de> wrote:
> 
> > Ah ok ... thanks for the clarification
> >
> >
> > 2013/4/10 Brandon Allbery <allbery.b at gmail.com>
> >
> >> On Wed, Apr 10, 2013 at 3:26 AM, Florian Hofmann <
> >> fhofmann at techfak.uni-bielefeld.de> wrote:
> >>
> >>> I might be mistaken, but is there a bug in the Show instance of
> >>> PortNum?
> >>>
> >>
> >> Not a bug, an annoying misdesign (IMO). A PortNum is actually in
> >> network byte order. If you extract it, you get the original port;
> >> if you simply show it, you see it byteswapped on little-endian
> >> platforms.
> >>
> >> --
> >> brandon s allbery kf8nh                               sine nomine
> >> associates
> >> allbery.b at gmail.com
> >> ballbery at sinenomine.net
> >> unix, openafs, kerberos, infrastructure, xmonad
> >> http://sinenomine.net
> >>
> >
> >
> > _______________________________________________
> > Haskell-Cafe mailing list
> > Haskell-Cafe at haskell.org
> > http://www.haskell.org/mailman/listinfo/haskell-cafe
> >
> >



More information about the Haskell-Cafe mailing list