Add Network.Socket.Types (internal reorganization) #70

wants to merge 1 commit into


None yet
2 participants

joeyadams commented Nov 25, 2012

This moves the definition of some types (Socket, SockAddr, etc.) and some of their helper functions to a new hidden module called Network.Socket.Types. This moves a lot of code around, but does not change the external interface.

I also added these accessors, but did not export them to users:

sockFd       (MkSocket n _ _ _ _) = n
sockFamily   (MkSocket _ f _ _ _) = f
sockType     (MkSocket _ _ t _ _) = t
sockProtocol (MkSocket _ _ _ p _) = p
sockStatus   (MkSocket _ _ _ _ s) = s

I'm working on a new IO manager for Windows based on completion ports. Having a Types module will let me implement Windows-specific bindings in a separate module, rather than clutter Network.Socket even more.

Add Network.Socket.Types (internal reorganization)
This does not change the external interface, except for making a few orphan
instances available in Network.Socket.Internal that weren't before
(e.g. Num instances for PortNumber).

tibbe commented Nov 29, 2012

Merged with minor tweaks.

@tibbe tibbe closed this Nov 29, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment