[Haskell-cafe] ANN: network 2.8.0.0

Viktor Dukhovni ietf-dane at dukhovni.org
Wed Sep 5 00:52:31 UTC 2018



> On Sep 4, 2018, at 6:22 PM, evan at evan-borden.com <evan at evanrutledgeborden.dreamhosters.com> wrote:
> 
> * Breaking change: PortNumber originally contained Word32 in network
>   byte order and used "deriving Ord". This results in strange behavior
>   on the Ord instance. Now PortNumber holds Word32 in host byte order.
>   [#347](https://github.com/haskell/network/pull/347)
> * Breaking change: stopping the export of the PortNum constructor in
>   PortNumber.

Small correction, the port number of course was and remains Word16 not Word32.

One might also note that to the extent that applications did use the
PortNumber in SockAddrInet, and SockAddrInet6 structures, they likely
relied on the Num, Enum and Integral instances, rather than using
"PortNum" directly.

Those instances made it possible to use numeric literals or "fromIntegral"
to create "PortNumber" from port numbers.  And this has not changed.  The
only thing that's no longer possible is direct use of the "PortNum" constructor
with values already in network byte order.  This should be a rare impediment,
and the removal of the constructor means that all problems are detected at
compile-time.

So this is unlikely to be an issue for the majority of applications, which
likely just use getaddrinfo() in any case, and don't build SockAddrInet*
structures "by hand".

-- 
	Viktor.



More information about the Haskell-Cafe mailing list