definition: |
splitArgs :: [VarIndex] -> [AExpr a] -> ([VarIndex], [((VarIndex, a), AExpr a)], [AExpr a]) splitArgs xs [] = (xs, [], []) splitArgs xs (e : es) = case e of AVar _ _ -> let (xs', ds, es') = splitArgs xs es -- type argument of ALet? in (xs', ds, e : es') _ -> let (x' : xs', e') = flattenExpr xs e (xs2, ds, es') = splitArgs xs' es a' = annExpr e' in (xs2, ((x', a'), e') : ds, AVar a' x' : es') |
demand: |
argument 2 |
deterministic: |
deterministic operation |
documentation: |
--- @splitArgs xs es = (xs', ds, es')@ replaces all non-variable --- expressions in @es@ by new variables subsequently taken from @xs@, --- and generates the bindings @ds@ for those lifted expressions. --- That is, @es'@ consists of variables only, originating either from @es@ --- or from @xs@, such that $es'[ds] = es$, i.e., replacing the extracted --- bindings again should yield the original list. --- @xs'@ is xs without the extracted variables. |
failfree: |
<FAILING> |
indeterministic: |
referentially transparent operation |
infix: |
no fixity defined |
iotype: |
{(_,{[]}) |-> {(,,)} || (_,{:}) |-> _} |
name: |
splitArgs |
precedence: |
no precedence defined |
result-values: |
{(,,)} |
signature: |
[Prelude.Int] -> [FlatCurry.Annotated.Types.AExpr a] -> ([Prelude.Int], [((Prelude.Int, a), FlatCurry.Annotated.Types.AExpr a)], [FlatCurry.Annotated.Types.AExpr a]) |
solution-complete: |
operation might suspend on free variables |
terminating: |
possibly non-terminating |
totally-defined: |
possibly non-reducible on same data term |