insertAt :: a -> [a] -> Int -> [a] insertAt x xs c = let k = c-1 in take k xs ++ x:(drop k xs)