]>
Commit | Line | Data |
---|---|---|
46039343 | 1 | module PursLoader.Plugin |
845f3ec3 | 2 | ( Compile() |
46039343 | 3 | , Context() |
87145c4d | 4 | , Options() |
46039343 | 5 | , DependencyGraph() |
46039343 | 6 | , dependenciesOf |
7 | ) where | |
8 | ||
9 | import Prelude (Unit()) | |
10 | ||
11 | import Control.Monad.Eff (Eff()) | |
12 | import Control.Monad.Eff.Exception (Error()) | |
13 | ||
14 | import Data.Either (Either(..)) | |
15 | import Data.Function (Fn4(), runFn4) | |
46039343 | 16 | import Data.Nullable (Nullable()) |
17 | ||
cb2f4c88 | 18 | type Compile eff = Nullable Error -> DependencyGraph -> String -> Eff eff Unit |
46039343 | 19 | |
87145c4d | 20 | type Context eff = { compile :: Compile eff -> Eff eff Unit, options :: Options } |
46039343 | 21 | |
87145c4d | 22 | type Options = { bundle :: Boolean, output :: String, bundleOutput :: String } |
46039343 | 23 | |
24 | dependenciesOf :: DependencyGraph -> String -> Either Error (Array String) | |
25 | dependenciesOf = runFn4 dependenciesOfFn Left Right | |
26 | ||
46039343 | 27 | foreign import data DependencyGraph :: * |
28 | ||
46039343 | 29 | foreign import dependenciesOfFn |
30 | :: Fn4 (Error -> Either Error (Array String)) | |
31 | (Array String -> Either Error (Array String)) | |
32 | DependencyGraph | |
33 | String | |
34 | (Either Error (Array String)) |