I have the function
getCode :: [(a, Int)] -> [a]
getCode = concatMap (uncurry replicate)`
I expect
getCode [(‘a’,4),(‘b’,1),(‘a’,3),(‘b’,1)]
to output
“aaaabaaab”
Instead I get an error that it does not match with the expected data type [(a,Int)], and the actual data type is [(Int,a)]. How do i change it to make it work? Or any other way?