summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCsaba Hruska <csaba.hruska@gmail.com>2018-02-03 09:29:05 +0100
committerCsaba Hruska <csaba.hruska@gmail.com>2018-02-03 09:29:05 +0100
commitde5872c078602df96e29951cde46ac007869428a (patch)
treeacd1a67a24de182fec0bb686e79c238432dff5ba
parent962c19cd1a6d93bf93544a5b8200e83766ae4dc5 (diff)
hide prelude path ; required for consitent error messages
-rw-r--r--src/LambdaCube/Compiler.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/LambdaCube/Compiler.hs b/src/LambdaCube/Compiler.hs
index d1c178ec..ecbf2da5 100644
--- a/src/LambdaCube/Compiler.hs
+++ b/src/LambdaCube/Compiler.hs
@@ -97,7 +97,7 @@ type ModuleFetcher m = Maybe FilePath -> Either FilePath MName -> m (Either Doc
97ioFetch :: MonadIO m => [FilePath] -> ModuleFetcher (MMT m x) 97ioFetch :: MonadIO m => [FilePath] -> ModuleFetcher (MMT m x)
98ioFetch paths' imp n = do 98ioFetch paths' imp n = do
99 preludePath <- (</> "lc") <$> liftIO getDataDir 99 preludePath <- (</> "lc") <$> liftIO getDataDir
100 let paths = map (id &&& id) paths' ++ [(preludePath, {-"<<installed-prelude-path>>"-}preludePath)] 100 let paths = map (id &&& id) paths' ++ [(preludePath, "<<installed-prelude-path>>")]
101 find ((x, (x', mn)): xs) = liftIO (readFileIfExists x) >>= maybe (find xs) (\src -> return $ Right (x', mn, liftIO src)) 101 find ((x, (x', mn)): xs) = liftIO (readFileIfExists x) >>= maybe (find xs) (\src -> return $ Right (x', mn, liftIO src))
102 find [] = return $ Left $ "can't find" <+> either (("lc file" <+>) . text) (("module" <+>) . text) n 102 find [] = return $ Left $ "can't find" <+> either (("lc file" <+>) . text) (("module" <+>) . text) n
103 <+> "in path" <+> hsep (text . snd <$> paths) 103 <+> "in path" <+> hsep (text . snd <$> paths)