Ticket #2998 (closed proposal: fixed)
Expose the internals of the network library to make it more extensible
|Reported by:||tibbe||Owned by:||igloo|
|Type of failure:||Difficulty:||Unknown|
|Test Case:||Blocked By:|
When creating new libraries on top of the network library it would be convenient if the library exposed some functions that hide platform variations so that the new libraries can be written in a portable manner.
Take for example the currently un-exported pokeSockAddr function which marshalls a SockAddr into a sockaddr struct. This function would be useful when e.g. writing a binding for the sendmsg system call. However, it's not exported so libraries are forced to define their own version.
This is unfortunate. I propose we add a new module, Network.Socket.Internal, to the network library, that exposes these portable marshalling functions. It might also be a good idea to expose some internal data representations in the same way bytestring currently does. People who write code that uses this internal do so knowing that there is a risk that the interface and data representations might change.
I've written a patch that exposes some of the library's internal functions. There are still some documentation to write and perhaps a few more functions to expose but I think we should reach consensus on whether this is a good idea to begin with before continuing.
Since this change isn't disruptive I propose a two week consideration deadline.