|
definition: |
take :: Int -> [a] -> [a]
take n l = if n <= 0 then [] else takep n l
where takep _ [] = []
takep m (x:xs) = x : take (m - 1) xs
|
|
demand: |
no demanded arguments |
|
deterministic: |
deterministic operation |
|
documentation: |
| Returns prefix of length n. |
|
failfree: |
(_, _) |
|
indeterministic: |
referentially transparent operation |
|
infix: |
no fixity defined |
|
iotype: |
{(_,_) |-> {:,[]}}
|
|
name: |
take |
|
precedence: |
no precedence defined |
|
result-values: |
{:,[]}
|
|
signature: |
Int -> [a] -> [a] |
|
solution-complete: |
operation might suspend on free variables |
|
terminating: |
possibly non-terminating |
|
totally-defined: |
reducible on all ground data terms |