aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Glob.purs
diff options
context:
space:
mode:
authoreric thul <thul.eric@gmail.com>2015-07-05 10:13:47 -0400
committereric thul <thul.eric@gmail.com>2015-07-06 23:53:01 -0400
commit1983893bf09a5c2ea1946e156be5da170075af7e (patch)
treef99bda0c0ff3c50356d8ab152336ba461c292494 /src/Glob.purs
parent4558c6cf7879207166b1cc013e2e8112f558bb1d (diff)
downloadpurs-loader-1983893bf09a5c2ea1946e156be5da170075af7e.tar.gz
purs-loader-1983893bf09a5c2ea1946e156be5da170075af7e.tar.zst
purs-loader-1983893bf09a5c2ea1946e156be5da170075af7e.zip
Updating for PureScript 0.7
Resolves #14
Diffstat (limited to 'src/Glob.purs')
-rw-r--r--src/Glob.purs31
1 files changed, 0 insertions, 31 deletions
diff --git a/src/Glob.purs b/src/Glob.purs
deleted file mode 100644
index 7bc9212..0000000
--- a/src/Glob.purs
+++ /dev/null
@@ -1,31 +0,0 @@
1module PursLoader.Glob
2 ( Glob()
3 , glob
4 ) where
5
6import Control.Monad.Aff (Aff(), makeAff)
7import Control.Monad.Eff (Eff())
8import Control.Monad.Eff.Exception (Error())
9
10import Data.Function
11
12foreign import data Glob :: !
13
14glob :: forall eff. String -> Aff (glob :: Glob | eff) [String]
15glob pattern = makeAff $ runFn3 globFn pattern
16
17foreign import globFn """
18function globFn(pattern, errback, callback) {
19 return function(){
20 var glob = require('glob');
21
22 glob(pattern, function(e, data){
23 if (e) errback(e)();
24 else callback(data)();
25 });
26 };
27}
28""" :: forall eff. Fn3 String
29 (Error -> Eff (glob :: Glob | eff) Unit)
30 ([String] -> Eff (glob :: Glob | eff) Unit)
31 (Eff (glob :: Glob | eff) Unit)