definition: |
replace :: a -> Int -> [a] -> [a] replace _ _ [] = [] replace x p (y:ys) | p==0 = x:ys | otherwise = y:(replace x (p-1) ys) |
demand: |
argument 3 |
deterministic: |
deterministic operation |
documentation: |
Replaces an element in a list. @param x - the new element @param p - the position of the new element (head = 0) @param ys - the old list @return the new list where the `p`. element is replaced by `x` |
failfree: |
(_, _, _) |
indeterministic: |
referentially transparent operation |
infix: |
no fixity defined |
iotype: |
{(_,_,{[]}) |-> {[]} || (_,_,{:}) |-> {:}} |
name: |
replace |
precedence: |
no precedence defined |
result-values: |
{:,[]} |
signature: |
a -> Prelude.Int -> [a] -> [a] |
solution-complete: |
operation might suspend on free variables |
terminating: |
yes |
totally-defined: |
possibly non-reducible on same data term |