Created
July 17, 2015 01:56
-
-
Save yelouafi/96ac30a00671b1ff9fb0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
span :: (a -> Bool) -> [a] -> ([a],[a]) | |
span _ this@[] = (this, this) | |
span p this@(x:xs) | |
| p x = let (ys,zs) = span p xs in (x:ys,zs) | |
| otherwise = ([],this) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment