definition: |
splitOn :: Eq a => [a] -> [a] -> [[a]] splitOn [] _ = error "splitOn called with an empty pattern" splitOn [x] xs = split (x ==) xs splitOn sep@(_:_:_) xs = go xs where go [] = [[]] go l@(y:ys) | sep `isPrefixOf` l = [] : go (drop len l) | otherwise = let (zs:zss) = go ys in (y:zs):zss len = length sep |
demand: |
argument 2 |
deterministic: |
deterministic operation |
documentation: |
Breaks the second list argument into pieces separated by the first list argument, consuming the delimiter. An empty delimiter is invalid, and will cause an error to be raised. |
failfree: |
(_, _, _) |
indeterministic: |
referentially transparent operation |
infix: |
no fixity defined |
iotype: |
{(_,{:},_) |-> {:}} |
name: |
splitOn |
precedence: |
no precedence defined |
result-values: |
{:} |
signature: |
Prelude.Eq a => [a] -> [a] -> [[a]] |
solution-complete: |
operation might suspend on free variables |
terminating: |
possibly non-terminating |
totally-defined: |
possibly non-reducible on same data term |