Hey, nice that you're here BlinkBoy, I'm having some trouble with this:
Code:
foldMatrizParaLista xs = nub . ( foldr (\y acc -> (fst(y)):acc) [] xs )
Basically, the function is supposed to take a list of tuples and build another list with only the first element of each tuple, eliminating repetitions, of course. The compiler says this:
PHP:
Couldn't match expected type `a -> [a1]' with actual type `[a2]'
Relevant bindings include
foldMatrizParaLista :: [(a2, b)] -> a -> [a1]
(bound at
I've got a much easier way to do this, but we were ordered to resort to foldl/r.