@@ -40,11 +40,13 @@ data IState = IState { tt_ctxt :: Context,
4040 syntax_keywords :: [String],
4141 imported :: [FilePath],
4242 idris_prims :: [(Name, ([E.Name], E.Term))],
43+ idris_objs :: [FilePath],
44+ idris_libs :: [String],
4345 errLine :: Maybe Int
4446 }
4547
4648idrisInit = IState emptyContext [] emptyContext emptyContext emptyContext
47− "" defaultOpts 6 [] [] [] [] [] Nothing
49+ "" defaultOpts 6 [] [] [] [] [] [] [] Nothing
4850
4951-- The monad for the main REPL - reading and processing files and updating
5052-- global state (hence the IO inner monad).
@@ -53,6 +55,18 @@ type Idris a = StateT IState IO a
5355getContext :: Idris Context
5456getContext = do i <- get; return (tt_ctxt i)
5557
58+getObjectFiles :: Idris [FilePath]
59+getObjectFiles = do i <- get; return (idris_objs i)
60+
61+addObjectFile :: FilePath -> Idris ()
62+addObjectFile f = do i <- get; put (i { idris_objs = f : idris_objs i })
63+
64+getLibs :: Idris [String]
65+getLibs = do i <- get; return (idris_libs i)
66+
67+addLib :: String -> Idris ()
68+addLib f = do i <- get; put (i { idris_libs = f : idris_libs i })
69+
5670setErrLine :: Int -> Idris ()
5771setErrLine x = do i <- get;
5872 case (errLine i) of
@@ -621,16 +635,16 @@ expandParamsD ist dec ps ns (PClauses fc opts n cs)
621635 PClauses fc opts n' (map expandParamsC cs)
622636 where
623637 expandParamsC (PClause n lhs ws rhs ds)
624− = let ps' = updateps True (namesIn ist rhs) (zip ps [0..])
625− ps'' = updateps False (namesIn ist lhs) (zip ps' [0..])
638+ = let -- ps' = updateps True (namesIn ist rhs) (zip ps [0..])
639+ ps'' = updateps False (namesIn ist lhs) (zip ps [0..])
626640 n' = if n `elem` ns then dec n else n in
627641 PClause n' (expandParams dec ps'' ns lhs)
628642 (map (expandParams dec ps'' ns) ws)
629643 (expandParams dec ps'' ns rhs)
630644 (map (expandParamsD ist dec ps'' ns) ds)
631645 expandParamsC (PWith n lhs ws wval ds)
632− = let ps' = updateps True (namesIn ist wval) (zip ps [0..])
633− ps'' = updateps False (namesIn ist lhs) (zip ps' [0..])
646+ = let -- ps' = updateps True (namesIn ist wval) (zip ps [0..])
647+ ps'' = updateps False (namesIn ist lhs) (zip ps [0..])
634648 n' = if n `elem` ns then dec n else n in
635649 PWith n' (expandParams dec ps'' ns lhs)
636650 (map (expandParams dec ps'' ns) ws)