1 module PursLoader.Plugin
12 import Prelude (Unit())
14 import Control.Monad.Eff (Eff())
15 import Control.Monad.Eff.Exception (Error())
17 import Data.Either (Either(..))
18 import Data.Function (Fn4(), runFn4)
19 import Data.Maybe (Maybe(..))
20 import Data.Nullable (Nullable())
22 type Result = { srcMap :: ImmutableMap String String, ffiMap :: ImmutableMap String String, graph :: DependencyGraph }
24 type Compile eff = Nullable Error -> Result -> Eff eff Unit
26 type Context eff = { compile :: Compile eff -> Eff eff Unit, options :: Options }
28 type Options = { bundle :: Boolean, output :: String, bundleOutput :: String }
30 get :: forall key value. ImmutableMap key value -> key -> Maybe value
31 get = runFn4 getFn Nothing Just
33 dependenciesOf :: DependencyGraph -> String -> Either Error (Array String)
34 dependenciesOf = runFn4 dependenciesOfFn Left Right
36 foreign import data ImmutableMap :: * -> * -> *
38 foreign import data DependencyGraph :: *
41 :: forall key value. Fn4 (Maybe value)
42 (value -> Maybe value)
43 (ImmutableMap key value)
47 foreign import dependenciesOfFn
48 :: Fn4 (Error -> Either Error (Array String))
49 (Array String -> Either Error (Array String))
52 (Either Error (Array String))