I have a following problem. My aim is to implement function that returns Char the n number of times
GHCi> nTimes 42 3
[42,42,42]
GHCi> nTimes 'z' 5
"zzzzz"
I have implemented such solution but recursion does not end
nTimes:: a -> Int -> [a]
nTimes a n = a : nTimes a (n-1)
And function just returs an unstoppable number Chars Thanks in advance,