@@ -221,10 +221,10 @@ decl' syn = fixity
221221-}
222222syntaxDecl :: SyntaxInfo -> IdrisParser PDecl
223223syntaxDecl syn = do s <- syntaxRule syn
224− i <- get
224+ i <- get
225225 put (i `addSyntax` s)
226226 fc <- getFC
227− return (PSyntax fc s)
227+ return (PSyntax fc s)
228228
229229-- | Extend an 'IState' with a new syntax extension. See also 'addReplSyntax'.
230230addSyntax :: IState -> Syntax -> IState
@@ -1203,14 +1203,14 @@ parseProg syn fname input mrk
12031203{- | Load idris module and show error if something wrong happens -}
12041204loadModule :: FilePath -> Idris (Maybe String)
12051205loadModule f
1206− = idrisCatch (fmap Just (loadModule' f))
1206+ = idrisCatch (loadModule' f)
12071207 (\e -> do setErrSpan (getErrSpan e)
12081208 ist <- getIState
12091209 iWarn (getErrSpan e) $ pprintErr ist e
12101210 return Nothing)
12111211
12121212{- | Load idris module -}
1213−loadModule' :: FilePath -> Idris String
1213+loadModule' :: FilePath -> Idris (Maybe String)
12141214loadModule' f
12151215 = do i <- getIState
12161216 let file = takeWhile (/= ' ') f
@@ -1218,7 +1218,8 @@ loadModule' f
12181218 ids <- allImportDirs
12191219 fp <- findImport ids ibcsd file
12201220 if file `elem` imported i
1221− then iLOG $ "Already read " ++ file
1221+ then do iLOG $ "Already read " ++ file
1222+ return Nothing
12221223 else do putIState (i { imported = file : imported i })
12231224 case fp of
12241225 IDR fn -> loadSource False fn Nothing
@@ -1229,9 +1230,7 @@ loadModule' f
12291230 case src of
12301231 IDR sfn -> loadSource False sfn Nothing
12311232 LIDR sfn -> loadSource True sfn Nothing)
1232− let (dir, fh) = splitFileName file
1233− return (dropExtension fh)
1234−
1233+ return $ Just file
12351234
12361235{- | Load idris code from file -}
12371236loadFromIFile :: Bool -> IFileType -> Maybe Int -> Idris ()
@@ -1270,7 +1269,7 @@ loadSource lidr f toline
12701269 let imports = map (\n -> (True, n, Just n, emptyFC)) ai ++ imports_in
12711270 ids <- allImportDirs
12721271 ibcsd <- valIBCSubDir i
1273− mapM_ (\(re, f) ->
1272+ mapM_ (\(re, f) ->
12741273 do fp <- findImport ids ibcsd f
12751274 case fp of
12761275 LIDR fn -> ifail $ "No ibc for " ++ f