span (< 0) [-1, -2, -3, 0, 1, 2, -3, -4, -5]?
I know the result is ([-1, -2, -3], [0, 1, 2, -3, -4, -5]), but the recursion flummoxes me.
Here's the Prelude definition:
mySpan :: (a -> Bool) -> [a] -> ([a], [a])
mySpan _ [] = ([], [])
mySpan p xs@(x:xs')
| p x = (x:ys, zs)
| otherwise = ([], xs)
where
(ys, zs) = mySpan p xs'
Thanks.