Proposal [Trac #1212]: add IPv6 support to network library

Sven Panne sven.panne at aedion.de
Sun Apr 1 06:50:10 EDT 2007


I've downloaded your darcs repo, and it built fine (openSUSE 10.2 x86_64). Two 
remarks:

   * You use an internal class HostAddr and make two type synonyms an instance 
of it. This has 2 drawbacks: It is not H98 and Haddock complains about a 
missing link destination. I think one could handle things easily without a 
class, because all possible instances are known at compile time.

   * The types and values of AddrInfoFlags/NameInfoFlags are not very 
Haskell-like. Using

        data AddrInfoFlag = Passive | CanonName | NumericHost | ...

     and [AddrInfoFlag] instead of AddrInfoFlags is much nicer. The only cost 
is that a tiny marshaling function has to be written. Same for NameInfoFlags. 
Interfaces writte this way are more type safe and one can easily see which 
alternatives are possible for a given set of flags in a single place.

Alas, the X11 package is not nice regarding the last item, either... :-(

Cheers,
   S.


More information about the Libraries mailing list