diff options
Diffstat (limited to 'src/PursLoader/Glob.purs')
-rw-r--r-- | src/PursLoader/Glob.purs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/PursLoader/Glob.purs b/src/PursLoader/Glob.purs new file mode 100644 index 0000000..45eeb56 --- /dev/null +++ b/src/PursLoader/Glob.purs | |||
@@ -0,0 +1,22 @@ | |||
1 | module PursLoader.Glob | ||
2 | ( Glob() | ||
3 | , globAll | ||
4 | ) where | ||
5 | |||
6 | import Prelude (Unit(), ($)) | ||
7 | |||
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 Glob :: ! | ||
15 | |||
16 | globAll :: forall eff. Array String -> Aff (glob :: Glob | eff) (Array (Array String)) | ||
17 | globAll patterns = makeAff $ runFn3 globAllFn patterns | ||
18 | |||
19 | foreign import globAllFn :: forall eff. Fn3 (Array String) | ||
20 | (Error -> Eff (glob :: Glob | eff) Unit) | ||
21 | ((Array (Array String)) -> Eff (glob :: Glob | eff) Unit) | ||
22 | (Eff (glob :: Glob | eff) Unit) | ||