Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 23rd, 2012  |  syntax: None  |  size: 0.19 KB  |  hits: 6  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. splitWith :: (a -> Bool) -> [a] -> [[a]]
  2. splitWith _ [] = [[]]
  3. splitWith pred xs = first : splitWith pred next where
  4.     (first, rest) = break pred xs
  5.     next = dropWhile ( not . pred ) rest