6 lines
148 B
Haskell
6 lines
148 B
Haskell
|
split :: [a] -> Int -> ([a], [a])
|
||
|
split x 0 = ([], x)
|
||
|
split (hd : tl) n = (hd : next_hd, next_tl)
|
||
|
where
|
||
|
(next_hd, next_tl) = split tl (n - 1)
|