scanl1

scanl1 is a variant of scanl that has no starting value argument:
scanl1 f [x1, x2, ...] == [x1, x1 `f` x2, ...]

Examples

>>> scanl1 (+) [1..4]
[1,3,6,10]
>>> scanl1 (+) []
[]
>>> scanl1 (-) [1..4]
[1,-1,-4,-8]
>>> scanl1 (&&) [True, False, True, True]
[True,False,False,False]
>>> scanl1 (||) [False, False, True, True]
[False,False,True,True]
>>> take 10 (scanl1 (+) [1..])
[1,3,6,10,15,21,28,36,45,55]
>>> take 1 (scanl1 undefined ('a' : undefined))
"a"
scanl1 is a variant of scanl that has no starting value argument:
scanl1 f [x1, x2, ...] == x1 :| [x1 `f` x2, x1 `f` (x2 `f` x3), ...]
scanl1 is a variant of scanl that has no starting value argument.
scanl1 f [x1, x2, ...] == [x1, x1 `f` x2, ...]
scanl1 is a variant of scanl that has no starting value argument:
scanl1 f [x1, x2, ...] == [x1, x1 `f` x2, ...]
scanl1 is a variant of scanl that has no starting value argument.
scanl1 f [x1, x2, ...] == [x1, x1 `f` x2, ...]
O(n) scanl1 is a variant of scanl that has no starting value argument. Performs replacement on invalid scalar values.
scanl1 f [x1, x2, ...] == [x1, x1 `f` x2, ...]
scanl1 is a variant of scanl that has no starting value argument:
scanl1 f (fromList [x1, x2, ...]) = fromList [x1, x1 `f` x2, ...]
scanl1 is a variant of scanl that has no starting value argument:
scanl1 f [x1, x2, ...] == [x1, x1 `f` x2, ...]
>>> scanl1 (+) [1..4]
[1,3,6,10]

>>> scanl1 (+) []
[]

>>> scanl1 (-) [1..4]
[1,-1,-4,-8]

>>> scanl1 (&&) [True, False, True, True]
[True,False,False,False]

>>> scanl1 (||) [False, False, True, True]
[False,False,True,True]

>>> scanl1 (+) [1..]
* Hangs forever *
scanl1 is a variant of scanl that has no starting value argument. This function will fuse.
scanl1 f [x1, x2, ...] == [x1, x1 `f` x2, ...]
scanl1 is a variant of scanl that has no starting value argument:
scanl1 f [x1, x2, ...] == [x1, x1 `f` x2, ...]
O(n) scanl1 is a variant of scanl that has no starting value argument. Subject to fusion. Performs replacement on invalid scalar values.
scanl1 f [x1, x2, ...] == [x1, x1 `f` x2, ...]
O(n) Scan over a non-empty vector
scanl f <x1,...,xn> = <y1,...,yn>
where y1 = x1
yi = f y(i-1) xi
O(n) Scan over a non-empty vector
scanl f <x1,...,xn> = <y1,...,yn>
where y1 = x1
yi = f y(i-1) xi
O(n) Scan over a non-empty vector
scanl f <x1,...,xn> = <y1,...,yn>
where y1 = x1
yi = f y(i-1) xi
O(n) Scan over a non-empty vector
scanl f <x1,...,xn> = <y1,...,yn>
where y1 = x1
yi = f y(i-1) xi
O(n) scanl1 is a variant of scanl that has no starting value argument. Subject to fusion. Performs replacement on invalid scalar values.
scanl1 f [x1, x2, ...] == [x1, x1 `f` x2, ...]
Equivalent to scanl1 from Data.List when applied to a String, but preserves all non-character data.
scanl f c == scanl1 f . (singleton c <>)
scanl1 is a variant of scanl that has no starting value argument. This function will fuse.
scanl1 f [x1, x2, ...] == [x1, x1 `f` x2, ...]
O(n) Scan over a non-empty vector.
O(n) Scan over a non-empty vector.
O(n) Scan over a non-empty vector.
O(n) Scan over a non-empty vector.
O(n) Scan over a non-empty vector.