haskell/network — pull request #66 by joeyadams (2012-11-06 04:54:00+00:00)
Title: Make Socket a record type

This commit gives `Socket` record fields:

data Socket = MkSocket
{ sockFd :: CInt -- ^ File descriptor
, sockFamily :: Family
, sockType :: SocketType
, sockProtocol :: ProtocolNumber
, sockStatus :: MVar SocketStatus
}
deriving Typeable

It also updates the network package to use record patterns and selectors on MkSocket. Now if we need to add fields to `Socket` in the future, we won't have to change so much code.

This API change should cause very little breakage. Even after adding a sixth field to MkSocket (`sockPuppet :: ()`), I was able to build [http-conduit][1] and its dependencies without modification.

[1]: http://hackage.haskell.org/package/http-conduit