[RFC] Network.Socket: change get/setSocketOption
Bertram Felgenhauer
bertram.felgenhauer at googlemail.com
Thu Jul 27 23:34:27 EDT 2006
Simon Marlow wrote:
> Simon PJ pointed out to me an alternative design using GADTs:
>
> data SocketOption a where
> ReuseAddr :: SocketOption Int
> ...
>
> getSocketOption :: Socket -> SocketOption a -> IO a
> setSocketOption :: Socket -> SocketOption a -> a -> IO ()
Ah, clever. But that's an easy change if GADTs become more widely
adopted.
> So I'm in favour of Bertram's proposal above...
I'm glad you like it.
> any other comments?
Apparently not? Or did they go to you directly?
Should I go ahead and (try to) make a CTimeVal type with Storable instance?
I now believe System.Posix.Time would be the best place for that (which
exists in the unix package.)
regards,
Bertram
More information about the Libraries
mailing list