Find sequences within lists.
Documentation
splitSeq :: (a -> a -> Bool) -> [a] -> [[a]]Source
Find sequences within a list and return them as new list of sequences. The first argument is a function that takes two subsequent elements of the given list (second argument) and returns whether the second element follows the first one in a sequence.
splitSeq ((==) . succ) [1,2,3,5,6,7] [[1,2,3],[5,6,7]]