aboutsummaryrefslogblamecommitdiffhomepage
path: root/src/PursLoader/ChildProcess.purs
blob: 3bd960b784b12f6016f489ca020c91fd06a205ae (plain) (tree)
1
2
3
4
5
6
7




                              

                            







                                            
                                                                                    

                                                          




                                                                                         
module PursLoader.ChildProcess
  ( ChildProcess()
  , spawn
  ) where

import Prelude (Unit(), ($))

import Control.Monad.Aff (Aff(), makeAff)
import Control.Monad.Eff (Eff())
import Control.Monad.Eff.Exception (Error())

import Data.Function

foreign import data ChildProcess :: !

spawn :: forall eff. String -> Array String -> Aff (cp :: ChildProcess | eff) String
spawn command args = makeAff $ runFn4 spawnFn command args

foreign import spawnFn :: forall eff. Fn4 String
                                          (Array String)
                                          (Error -> Eff (cp :: ChildProcess | eff) Unit)
                                          (String -> Eff (cp :: ChildProcess | eff) Unit)
                                          (Eff (cp :: ChildProcess | eff) Unit)