Created
October 27, 2013 23:09
-
-
Save markmarch/7189020 to your computer and use it in GitHub Desktop.
splitWith
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 f lst = case dropWhile notF lst of | |
| [] -> [] | |
| lst' -> x : (splitWith f lst'') | |
| where (x, lst'') = break notF lst' | |
| where notF = not . f |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment