]>
Commit | Line | Data |
---|---|---|
c194f84c | 1 | module PursLoader.ChildProcess |
2 | ( ChildProcess() | |
3 | , spawn | |
4 | ) where | |
5 | ||
03b840cb | 6 | import Prelude (Unit(), ($)) |
7 | ||
c194f84c | 8 | import Control.Monad.Aff (Aff(), makeAff) |
9 | import Control.Monad.Eff (Eff()) | |
10 | import Control.Monad.Eff.Exception (Error()) | |
11 | ||
12 | import Data.Function | |
13 | ||
14 | foreign import data ChildProcess :: ! | |
15 | ||
03b840cb | 16 | spawn :: forall eff. String -> Array String -> Aff (cp :: ChildProcess | eff) String |
c194f84c | 17 | spawn command args = makeAff $ runFn4 spawnFn command args |
18 | ||
03b840cb | 19 | foreign import spawnFn :: forall eff. Fn4 String |
20 | (Array String) | |
21 | (Error -> Eff (cp :: ChildProcess | eff) Unit) | |
22 | (String -> Eff (cp :: ChildProcess | eff) Unit) | |
23 | (Eff (cp :: ChildProcess | eff) Unit) |