
3 Sep
2003
3 Sep
'03
10:51 a.m.
On Wednesday 03 September 2003 10:30, Wamberto Vasconcelos wrote:
Which seems to work:
Main> take 20 all_fib [1.0,1.0,2.0,3.0,5.0,8.0,13.0,21.0,34.0,55.0,89.0,144.0,233.0,377.0, 610.0,987.0,1597.0,2584.0,4181.0,6765.0]
However, when I tried
Main> filter even (take 20 all_fib) ERROR - Illegal Haskell 98 class constraint in inferred type *** Expression : filter even (take 20 all_fib) *** Type : Integral Float => [Float]
What is going on here?
"even" wants an integral type for its argument, but you are applying it to a list of floats. Konrad.