summaryrefslogtreecommitdiff
path: root/src/LambdaCube
diff options
context:
space:
mode:
Diffstat (limited to 'src/LambdaCube')
-rw-r--r--src/LambdaCube/Compiler.hs9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/LambdaCube/Compiler.hs b/src/LambdaCube/Compiler.hs
index fbd2203e..7e28a3ad 100644
--- a/src/LambdaCube/Compiler.hs
+++ b/src/LambdaCube/Compiler.hs
@@ -124,11 +124,12 @@ ioFetch paths' imp n = do
124 let paths = paths' ++ [preludePath] 124 let paths = paths' ++ [preludePath]
125 find ((x, mn): xs) = liftIO (readFile' x) >>= maybe (find xs) (\src -> return (x, mn, liftIO src)) 125 find ((x, mn): xs) = liftIO (readFile' x) >>= maybe (find xs) (\src -> return (x, mn, liftIO src))
126 find [] = throwError $ show $ "can't find " <+> either (("lc file" <+>) . text) (("module" <+>) . text) n 126 find [] = throwError $ show $ "can't find " <+> either (("lc file" <+>) . text) (("module" <+>) . text) n
127 <+> "in path" <+> hsep (map text paths) 127 <+> "in path" <+> hsep (map text (paths' ++ ["<<installed-prelude-path>>"]{-todo-}))
128 lcModuleFile path = case n of
129 Left n -> (path </> n, fileNameToModuleName n)
130 Right n -> (path </> moduleNameToFileName n, n)
131 find $ nubBy ((==) `on` fst) $ map (first normalise . lcModuleFile) paths 128 find $ nubBy ((==) `on` fst) $ map (first normalise . lcModuleFile) paths
129 where
130 lcModuleFile path = case n of
131 Left n -> (path </> n, fileNameToModuleName n)
132 Right n -> (path </> moduleNameToFileName n, n)
132 133
133-------------------------------------------------------------------------------- 134--------------------------------------------------------------------------------
134 135