PROPOSAL: add tryFdSeek to unix

wren ng thornton wren at
Thu Jun 30 05:35:24 CEST 2011

On 6/29/11 3:18 PM, Simon Marlow wrote:
> I think it would make sense to refactor the unix package into a very
> thin "just the foreign imports" layer, and then the current unix as a
> layer on top of that.

Now that you mention it, I think that'd actually be really nice.

On the one hand, a lot of unix is just hsc2hs code for accessing C-bits;
on the other hand, a lot of unix is the various wrappers to provide a more
Haskell-like interface to C. Speaking technically, the former is the hard
part since it involves dealing with cross-platform and other compatibility
issues. Though the latter is clearly more challenging as an
aesthetic/ergonomic problem; which are too often overlooked in
programming. It's very sensible to handle the different problems in
different packages.

> It doesn't make a great deal of sense to do this for just one function,
> though. It would stick out like a sore thumb in the API.

True. FWIW, the String-based API in System.Posix.IO already exposes some
relatively raw wrappers to C. But even System.Posix.IO is just one module,
which would still stick out considering how many modules unix has.

Live well,

More information about the Libraries mailing list