X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FPursLoader%2FLoader.purs;h=d1068b6b91b896939b9cf491cfd694ab168fe91e;hb=17f22f868b851e50081844562627a7a8a414dcaa;hp=49c5f24cf7c02463bd6847cc7248a2e5c43d69a3;hpb=b1b6e1467b844c502d91a4f46e3eaa9122b20e31;p=github%2Ffretlink%2Fpurs-loader.git diff --git a/src/PursLoader/Loader.purs b/src/PursLoader/Loader.purs index 49c5f24..d1068b6 100644 --- a/src/PursLoader/Loader.purs +++ b/src/PursLoader/Loader.purs @@ -7,6 +7,7 @@ module PursLoader.Loader import Prelude (Unit(), ($), (>>=), (<$>), (<*>), (++), bind, const, id, pure, unit) import Control.Apply ((*>)) +import Control.Alt ((<|>)) import Control.Bind (join) import Control.Monad.Eff (Eff(), foreachE) import Control.Monad.Eff.Exception (Error(), error) @@ -63,7 +64,7 @@ loader ref source = do addDependency ref (resourcePath ref) - either (\err -> callback (Just err) "") id + either (\err -> callback (toMaybe error' <|> Just err) "") id (handle <$> name <*> dependencies <*> exports) where handle :: String -> Array String -> String -> Eff (Effects eff) Unit