@@ -220,10 +220,10 @@ decl' syn = fixity
220220-}
221221syntaxDecl :: SyntaxInfo -> IdrisParser PDecl
222222syntaxDecl syn = do s <- syntaxRule syn
223− i <- get
223+ i <- get
224224 put (i `addSyntax` s)
225225 fc <- getFC
226− return (PSyntax fc s)
226+ return (PSyntax fc s)
227227
228228-- | Extend an 'IState' with a new syntax extension. See also 'addReplSyntax'.
229229addSyntax :: IState -> Syntax -> IState
@@ -1202,14 +1202,14 @@ parseProg syn fname input mrk
12021202{- | Load idris module and show error if something wrong happens -}
12031203loadModule :: FilePath -> Idris (Maybe String)
12041204loadModule f
1205− = idrisCatch (fmap Just (loadModule' f))
1205+ = idrisCatch (loadModule' f)
12061206 (\e -> do setErrSpan (getErrSpan e)
12071207 ist <- getIState
12081208 iWarn (getErrSpan e) $ pprintErr ist e
12091209 return Nothing)
12101210
12111211{- | Load idris module -}
1212−loadModule' :: FilePath -> Idris String
1212+loadModule' :: FilePath -> Idris (Maybe String)
12131213loadModule' f
12141214 = do i <- getIState
12151215 let file = takeWhile (/= ' ') f
@@ -1217,7 +1217,8 @@ loadModule' f
12171217 ids <- allImportDirs
12181218 fp <- findImport ids ibcsd file
12191219 if file `elem` imported i
1220− then iLOG $ "Already read " ++ file
1220+ then do iLOG $ "Already read " ++ file
1221+ return Nothing
12211222 else do putIState (i { imported = file : imported i })
12221223 case fp of
12231224 IDR fn -> loadSource False fn Nothing
@@ -1228,9 +1229,7 @@ loadModule' f
12281229 case src of
12291230 IDR sfn -> loadSource False sfn Nothing
12301231 LIDR sfn -> loadSource True sfn Nothing)
1231− let (dir, fh) = splitFileName file
1232− return (dropExtension fh)
1233−
1232+ return $ Just file
12341233
12351234{- | Load idris code from file -}
12361235loadFromIFile :: Bool -> IFileType -> Maybe Int -> Idris ()
@@ -1269,7 +1268,7 @@ loadSource lidr f toline
12691268 let imports = map (\n -> (True, n, Just n, emptyFC)) ai ++ imports_in
12701269 ids <- allImportDirs
12711270 ibcsd <- valIBCSubDir i
1272− mapM_ (\(re, f) ->
1271+ mapM_ (\(re, f) ->
12731272 do fp <- findImport ids ibcsd f
12741273 case fp of
12751274 LIDR fn -> ifail $ "No ibc for " ++ f