From 8c7e311338b5e2ab4be2f82533cf14d2e33761ed Mon Sep 17 00:00:00 2001 From: "Niels G. W. Serup" Date: Sat, 21 Sep 2024 19:32:32 +0200 Subject: [PATCH] Connect GetListElem to outer input list --- byg/src/ComputationM.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/byg/src/ComputationM.hs b/byg/src/ComputationM.hs index fb3ac8b..25ee2cd 100644 --- a/byg/src/ComputationM.hs +++ b/byg/src/ComputationM.hs @@ -12,7 +12,7 @@ data TypedRun a b where Function :: IsFunction f a b => f -> TypedRun a b FunctionIO :: IsFunctionIO f a b => f -> TypedRun a b Inject :: b -> TypedRun () b - GetListElem :: TypedRun () b + GetListElem :: TypedRun [b] b SetListElem :: TypedRun a () MapComp :: [DependencyUntyped] -> TypedRun [a] [b] @@ -57,8 +57,8 @@ genDependency g = do inject :: Show a => a -> ComputationM a inject x = genDependency (Dependency NoToken (Inject x)) -getListElem :: Show a => ComputationM a -getListElem = genDependency (Dependency NoToken GetListElem) +getListElem :: Show a => Token [a] -> ComputationM a +getListElem outer = genDependency (Dependency outer GetListElem) setListElem :: Show a => Token a -> ComputationM () setListElem a = genDependency (Dependency a SetListElem) @@ -86,6 +86,6 @@ mapComputationM f input = do genDependency (Dependency input (MapComp res)) where m :: ComputationM () m = do - inp <- getListElem + inp <- getListElem input outp <- f inp setListElem outp