on master help sign in
make sure the entry is added to the generated src code for /repl
dbf582aEvan Czaplicki
worker/src/Endpoint/Repl.hs+6−7
@@ -158,15 +158,14 @@ data EntryType
158
158
159
159
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 =
162 let
162 let
163 source =
163 source =
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)
170 in
169 in
171 case
170 case
172 do modul <- mapLeft Error.BadSyntax $ Parse.fromByteString Parse.Application source
171 do modul <- mapLeft Error.BadSyntax $ Parse.fromByteString Parse.Application source