Re: Socket library ghc 5.02.1

2001-11-27 Thread Sven Eric Panitz
From: Sigbjorn Finne [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] References: [EMAIL PROTECTED] Date: Mon, 26 Nov 2001 12:30:47 -0800 Sven Eric Panitz [EMAIL PROTECTED] writes: It seems that the Socket library does still not

Re: Socket library ghc 5.02.1

2001-11-27 Thread Sigbjorn Finne
Conclusion: you're hosed with ghc-5.02.1 and its socket libs under Win32. Sorry. If you don't mind getting your hands a (little) bit dirty, here's a story that will work ghc-5.02.1: * edit SocketPrim.hi (and SocketPrim.p_hi), to instead of saying Socket in its __export section it

Casting dynamic values

2001-11-27 Thread George Russell
It would occasionally be nice to have a function cast :: (Typeable a,Typeable b) = a - Maybe b which returns Just a if a and b have the same type, and Nothing otherwise. This may seem rather a curious need, but it arises with existential types; if you have data A = forall a . (context) = A

Re: Casting dynamic values

2001-11-27 Thread Alastair David Reid
George Russell [EMAIL PROTECTED] writes: cast :: (Typeable a,Typeable b) = a - Maybe b cast = fromDynamic . toDyn My question is: is this the most efficient way of doing it, or is there a better way? I think I'd do it that way. toDyn and fromDynamic are both pretty simple functions.