definition:
|
mapAccumL :: (acc -> x -> (acc, y)) -> acc -> [x] -> (acc, [y])
mapAccumL _ s [] = (s, [])
mapAccumL f s (x:xs) = (s'',y:ys)
where (s', y ) = f s x
(s'',ys) = mapAccumL f s' xs
|
demand:
|
argument 3
|
deterministic:
|
deterministic operation
|
documentation:
|
--- The `mapAccumL` function behaves like a combination of `map` and
--- `foldl`; it applies a function to each element of a list, passing
--- an accumulating parameter from left to right, and returning a final
--- value of this accumulator together with the new list.
|
failfree:
|
(_, _, _)
|
indeterministic:
|
referentially transparent operation
|
infix:
|
no fixity defined
|
iotype:
|
{(_,_,{[]}) |-> {(,)} || (_,_,{:}) |-> {(,)}}
|
name:
|
mapAccumL
|
precedence:
|
no precedence defined
|
result-values:
|
{(,)}
|
signature:
|
(a -> b -> (a, c)) -> a -> [b] -> (a, [c])
|
solution-complete:
|
operation might suspend on free variables
|
terminating:
|
yes
|
totally-defined:
|
reducible on all ground data terms
|