[Haskell-cafe] Re: exitFailure under forkProcess

Andrew Pimlott andrew at pimlott.net
Wed Oct 27 13:10:18 EDT 2004


On Wed, Oct 27, 2004 at 11:30:12AM +0100, Simon Marlow wrote:
> The System.Posix library is severely lacking in documentation.  Ideally
> for each function it would list the POSIX equivalent, and a table with
> the mapping in the other direction would be useful too.

One idea on this topic:  Many POSIX wrappers, eg getProcessStatus[1],
take mysterious Boolean arguments.  I commonly create a new type when I
have a function like this, so it might be

    data Blocking = Blocking | NonBlocking
    data IncludeStopped = IncludeStopped | ExcludeStopped
    getProcessStatus :: Blocking -> IncludeStopped -> ProcessID
                            -> IO (Maybe ProcessStatus)

Would this make these functions easier to use, or would it just be an
additional annoyance to have to look up the values of these type?  (I
may have picked an extreme example, because even someone who knows POSIX
by heart couldn't be sure which Boolean is which!)

Andrew

[1] http://haskell.org/ghc/docs/latest/html/libraries/unix/System.Posix.Process.html#v%3AgetProcessStatus


More information about the Haskell-Cafe mailing list