definition: |
span :: (a -> Bool) -> [a] -> ([a], [a]) span _ [] = ([], []) span p (x:xs) | p x = let (ys, zs) = span p xs in (x : ys, zs) | otherwise = ([], x : xs) |
demand: |
argument 2 |
deterministic: |
deterministic operation |
documentation: |
`span p xs` is equivalent to `(takeWhile p xs, dropWhile p xs)` |
failfree: |
(_, _) |
indeterministic: |
referentially transparent operation |
infix: |
no fixity defined |
iotype: |
{(_,{[]}) |-> {(,)} || (_,{:}) |-> {(,)}} |
name: |
span |
precedence: |
no precedence defined |
result-values: |
{(,)} |
signature: |
(a -> Bool) -> [a] -> ([a], [a]) |
solution-complete: |
operation might suspend on free variables |
terminating: |
yes |
totally-defined: |
possibly non-reducible on same data term |