From 0a9fdc2d41b1d4ac1aa48bdd99d74d770533fdf8 Mon Sep 17 00:00:00 2001 From: hanjoosten Date: Sun, 16 Jun 2024 11:54:18 +0200 Subject: [PATCH] Fix geteration of prototype (because of casualty of refactoring) --- src/Ampersand/FSpec/ToFSpec/CreateFspec.hs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/Ampersand/FSpec/ToFSpec/CreateFspec.hs b/src/Ampersand/FSpec/ToFSpec/CreateFspec.hs index 30c32e516..c8eba56ba 100644 --- a/src/Ampersand/FSpec/ToFSpec/CreateFspec.hs +++ b/src/Ampersand/FSpec/ToFSpec/CreateFspec.hs @@ -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