@@ -158,15 +158,14 @@ data EntryType
158158
159159
160160compile :: A.Artifacts -> Repl.State -> EntryType -> Outcome
161−compile (A.Artifacts interfaces objects) state entryType =
161+compile (A.Artifacts interfaces objects) state@(Repl.State imports types decls) entryType =
162162 let
163163 source =
164− Repl.toByteString state $
165− case entryType of
166− ImportEntry _ _ -> Repl.OutputNothing
167− TypeEntry _ _ -> Repl.OutputNothing
168− DeclEntry name _ -> Repl.OutputDecl name
169− ExprEntry src -> Repl.OutputExpr src
164+ case entryType of
165+ ImportEntry name src -> Repl.toByteString (state { Repl._imports = Map.insert name (B.byteString src) imports }) Repl.OutputNothing
166+ TypeEntry name src -> Repl.toByteString (state { Repl._types = Map.insert name (B.byteString src) types }) Repl.OutputNothing
167+ DeclEntry name src -> Repl.toByteString (state { Repl._decls = Map.insert name (B.byteString src) decls }) (Repl.OutputDecl name)
168+ ExprEntry src -> Repl.toByteString state (Repl.OutputExpr src)
170169 in
171170 case
172171 do modul <- mapLeft Error.BadSyntax $ Parse.fromByteString Parse.Application source