|
definition: |
separateAndReplace :: (a -> Bool) -> (a -> [a]) -> [a] -> [[a]]
separateAndReplace pred f list = case rest of
[] -> case sep of
[] -> []
_ -> [sep]
(x:xs) -> case sep of
[] -> f x : separateAndReplace pred f xs
_ -> sep : f x : separateAndReplace pred f xs
where (sep,rest) = break (not . pred) list
|
|
demand: |
no demanded arguments |
|
deterministic: |
deterministic operation |
|
failfree: |
(_, _, _) |
|
indeterministic: |
referentially transparent operation |
|
infix: |
no fixity defined |
|
iotype: |
{(_,_,_) |-> {:,[]}}
|
|
name: |
separateAndReplace |
|
precedence: |
no precedence defined |
|
result-values: |
{:,[]}
|
|
signature: |
(a -> Prelude.Bool) -> (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 |