Skip to content

Instantly share code, notes, and snippets.

@PyroLagus
Created December 5, 2015 22:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PyroLagus/f7d86fff95550a5af688 to your computer and use it in GitHub Desktop.
Save PyroLagus/f7d86fff95550a5af688 to your computer and use it in GitHub Desktop.
splitWith :: (a -> Bool) -> [a] -> [[a]]
splitWith p (x:xs) | p x = splitWith p xs
| otherwise = [x] : splitWith p xs
splitWith _ [] = []
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment