Re: [Haskell-cafe] Of phantom types and type extentions

2007-10-16 Thread Bertram Felgenhauer
Thomas M. DuBuisson wrote: The solution I would want looks like this: class NetworkAddress a where addressByteSize :: a - Int instance (NetworkAddress a) = Binary (AddressBlock a) where get = do lenH - get h- replicateM get

[Haskell-cafe] Of phantom types and type extentions

2007-10-15 Thread Thomas M. DuBuisson
All, I've been casually developing a PacketBB (i.e. Generalized Manet Packet Format) library in Haskell. I think I have a need to pass state information as a phantom type - I'll step through the issue now. With the 'AddressBlock' (S5.2.1 packetBB draft 8), network addresses are abbreviated as