summaryrefslogblamecommitdiff
path: root/21-28/21.hs
blob: 4cbeb49b19b88af0dc00dd835eb814d54779edb1 (plain) (tree)
1
2
3
4
5




                                                     
insertAt :: a -> [a] -> Int -> [a]

insertAt e (x:xs) n | n > 1 = x:insertAt e xs (n - 1)
insertAt e l 1 = e:l
insertAt _ l _ = l