Closed
Description
I would like to extract the code that deals with Node's child_process
module from Pulp (which I recently ported to PureScript) into a separate library, and so this is the obvious candidate, but I don't think it's completely suitable as it currently is. How would you feel about the following:
- the
env
option in aSpawnOptions
record might be better typed asStrMap String
, because currently, each property could be any type, but they should only beString
, I think. - Also, it would be useful to make the
env
optionNullable
, as the Node API allows you to passnull
to inherit the parent's environment. - Using a record type for
ChildProcess
is perhaps a bit unsafe, as we probably shouldn't allow updating of its fields. How about having a newtype without exporting the constructor, and then export functions to access those fields? gid
,uid
, andpid
should probably beInt
, notNumber
.- Reading mutable state of a child process, eg
connected
, should probably requireEff
. - Do we gain from having a separate effect for each of stderr, stdin, stdout? How about just using
Spawn
for these too? - Using
Array String
for thestdio
option is a little limiting, as the Node API allows you to pass other things instead of strings too, like streams or file descriptors. Also, in the case where you are passing a string, there are a specific set of valid values. We could just useForeign
here, or try to define a sum type, like I did in Pulp.
I would very happily send a PR with these things, if you agree. Also it might be nice to put this under purescript-node
and/or publish it to Bower? If maintenance burden is an issue I'd happily take some of that on.
Metadata
Metadata
Assignees
Labels
No labels