|
definition: |
splitAt :: Int -> [a] -> ([a], [a])
splitAt n l = if n <= 0 then ([], l) else splitAtp n l
where splitAtp _ [] = ([], [])
splitAtp m (x:xs) = let (ys, zs) = splitAt (m - 1) xs in (x : ys, zs)
|
|
demand: |
no demanded arguments |
|
deterministic: |
deterministic operation |
|
documentation: |
| `splitAt n xs` is equivalent to `(take n xs, drop n xs)` |
|
failfree: |
(_, _) |
|
indeterministic: |
referentially transparent operation |
|
infix: |
no fixity defined |
|
iotype: |
{(_,_) |-> {(,)}}
|
|
name: |
splitAt |
|
precedence: |
no precedence defined |
|
result-values: |
{(,)}
|
|
signature: |
Int -> [a] -> ([a], [a]) |
|
solution-complete: |
operation might suspend on free variables |
|
terminating: |
possibly non-terminating |
|
totally-defined: |
reducible on all ground data terms |