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