Last active
August 29, 2015 14:19
-
-
Save quephird/c3bd60d9b5aea64997e1 to your computer and use it in GitHub Desktop.
Solution to number two here: http://book.realworldhaskell.org/read/functional-programming.html#id591678
This file contains hidden or 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
splitWith :: (a -> Bool) -> [a] -> [[a]] | |
splitWith p l | |
| null l = [] | |
| null xs = splitWith p $ tail xs' | |
| otherwise = xs : splitWith p xs' where | |
(xs, xs') = break p l |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment