4 lines
121 B
Haskell
4 lines
121 B
Haskell
insertAt :: a -> [a] -> Int -> [a]
|
|
insertAt x ls n = left ++ [x] ++ right
|
|
where
|
|
(left, right) = splitAt (n - 1) ls
|