Non-exhaustive pattern in Socket.hsc
Bulat Ziganshin
bulat.ziganshin at gmail.com
Wed May 3 06:01:46 EDT 2006
Hello Einar,
Wednesday, May 3, 2006, 1:34:35 PM, you wrote:
> On 02.05 13:05, Ashley Yakeley wrote:
>> That's a good question. C/C++ uses this address-family-based approach to
>> handle different protocols, but I think Haskell would do better with a
>> static approach that typed sockets by network. For instance:
>>
>> newtype IP4Address = IP4Address Word32
>> newtype IP6Address = IP6Address Word128
>>
>> openTCP4 :: IP4Address -> Word16 -> IO (TCPConnection IP4Address)
>> -- or use classes
> This is going to be painfull for applications that want to support
> multiple protocols. Why should most applications care whether
> it is an IPv4 or an IPv6 address if everything just works?
type classes?
(it's universal answer, after all :) )
--
Best regards,
Bulat mailto:Bulat.Ziganshin at gmail.com
More information about the Libraries
mailing list