diff options
author | Csaba Hruska <csaba.hruska@gmail.com> | 2018-02-03 10:21:34 +0100 |
---|---|---|
committer | Csaba Hruska <csaba.hruska@gmail.com> | 2018-02-03 10:21:34 +0100 |
commit | 66188f40cd84b8f16a917125e618b78a49350ab2 (patch) | |
tree | 317b86b1dc7a3d6b34fe700475369e253e345560 | |
parent | 04b5d835edf6d52d2166b2832f191d081c461bc0 (diff) |
keep real filepath for file info
-rw-r--r-- | src/LambdaCube/Compiler.hs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/LambdaCube/Compiler.hs b/src/LambdaCube/Compiler.hs index ecbf2da5..c0fef7a0 100644 --- a/src/LambdaCube/Compiler.hs +++ b/src/LambdaCube/Compiler.hs | |||
@@ -98,7 +98,7 @@ ioFetch :: MonadIO m => [FilePath] -> ModuleFetcher (MMT m x) | |||
98 | ioFetch paths' imp n = do | 98 | ioFetch 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>>")] | 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) |
104 | find $ nubBy ((==) `on` fst) $ map (first normalise . lcModuleFile) paths | 104 | find $ nubBy ((==) `on` fst) $ map (first normalise . lcModuleFile) paths |