Skip to content

Commit

Permalink
Fix geteration of prototype (because of casualty of refactoring)
Browse files Browse the repository at this point in the history
  • Loading branch information
hanjoosten committed Jun 16, 2024
1 parent 2771b24 commit 0a9fdc2
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/Ampersand/FSpec/ToFSpec/CreateFspec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -88,19 +88,26 @@ createFspec =
pCtx2Fspec env userScr
grindInto FormalAmpersand userFspc
Prototype -> do
let oneFspec = do
let guardedOne = do
userPCtx <- userScript
pcScript <- prototypeContextScript
checkPrototypeContextTransformers env pcScript
pCtx2Fspec env (userPCtx `mergeContexts` pcScript) -- this is done to typecheck the combination
grindInto PrototypeContext oneFspec
pure $ userPCtx `mergeContexts` pcScript -- this is done to typecheck the combination
let oneFspec = pCtx2Fspec env =<< guardedOne -- this is done to typecheck the combination
guardedTwo <- grindInto PrototypeContext oneFspec
pure $ do
one <- guardedOne
two <- guardedTwo
pure (one `mergeContexts` two)
RAP -> do
-- combine userscript, formalAmpersand and prototypeContext
let guardedOne = do
rapPCtx <- userScript
faScript <- formalAmpersandScript
pcScript <- prototypeContextScript
return $ rapPCtx `mergeContexts` pcScript `mergeContexts` faScript
pure $ rapPCtx `mergeContexts` pcScript `mergeContexts` faScript
let oneFspec = pCtx2Fspec env =<< guardedOne -- this is done to typecheck the combination
-- build a prototype with the combination
guardedTwo <- grindInto PrototypeContext oneFspec
pure $ do
pcScript <- prototypeContextScript
Expand Down

0 comments on commit 0a9fdc2

Please sign in to comment.