definition: |
insertBy :: (a -> a -> Bool) -> a -> [a] -> [a] insertBy _ x [] = [x] insertBy le x (y:ys) = if le x y then x : y : ys else y : insertBy le x ys |
demand: |
argument 3 |
deterministic: |
deterministic operation |
documentation: |
Inserts an object into a list according to an ordering relation. @param le - an ordering relation (e.g., less-or-equal) @param x - an element @param xs - a list @return a list where the element has been inserted |
failfree: |
(_, _, _) |
indeterministic: |
referentially transparent operation |
infix: |
no fixity defined |
iotype: |
{(_,_,{[]}) |-> {:} || (_,_,{:}) |-> {:}} |
name: |
insertBy |
precedence: |
no precedence defined |
result-values: |
{:} |
signature: |
(a -> a -> Prelude.Bool) -> a -> [a] -> [a] |
solution-complete: |
operation might suspend on free variables |
terminating: |
yes |
totally-defined: |
reducible on all ground data terms |