Am 03.06.2010 08:05 schrieb Ketil Malde:
Antoine Latter <[email protected]> writes:

  *Main> PortNum 8888
  47138

The PortNum constructor should rarely be used directly

So, shouldn't the constructor be hidden, and exported from an .Internal
module?
- it contains the port number in network-order. You should try:

Or perhaps even better, the type could be:

    data PortNum = PortNum { msb, lsb :: Word8 }

so that we avoid this kind of confusion?

-k

Hi,

since this is really not obvious, I'd second to hide the constructor or at least a note should be added to the docs how to use PortNumber correctly.


Regards,

Matthias
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to