4
I wrote a script in Haskell to find filter the odd numbers from a list and show them on the screen, but I keep getting an error when displaying the results..
impares[] =[]
impares(x:xs)
|(mod(x 2)==0) = impares xs
|otherwise = x:(impares xs)
the error is as follows:
no instance for (show (a10 -> a0)) arising from a use of 'print'
Apparently there’s nothing wrong with my code, but I can’t run this program! Someone can shed some light?
Gratitude! now I’ve connected as eh!
– roooooon
impares = filter odd
is very elegant. Good suggestion.– Gabriel