@@ -158,15 +158,14 @@ data EntryType
160compile :: A.Artifacts -> Repl.State -> EntryType -> Outcome
160compile :: 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 =
164− Repl.toByteString state $
165− case entryType of
164+ case entryType of
166− ImportEntry _ _ -> Repl.OutputNothing
165+ ImportEntry name src -> Repl.toByteString (state { Repl._imports = Map.insert name (B.byteString src) imports }) Repl.OutputNothing
167− TypeEntry _ _ -> Repl.OutputNothing
166+ TypeEntry name src -> Repl.toByteString (state { Repl._types = Map.insert name (B.byteString src) types }) Repl.OutputNothing
168− DeclEntry name _ -> Repl.OutputDecl name
167+ DeclEntry name src -> Repl.toByteString (state { Repl._decls = Map.insert name (B.byteString src) decls }) (Repl.OutputDecl name)
169− ExprEntry src -> Repl.OutputExpr src
168+ ExprEntry src -> Repl.toByteString state (Repl.OutputExpr src)
172 do modul <- mapLeft Error.BadSyntax $ Parse.fromByteString Parse.Application source
171 do modul <- mapLeft Error.BadSyntax $ Parse.fromByteString Parse.Application source