Connect GetListElem to outer input list
This commit is contained in:
		@@ -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
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user