Prior to ghc 7.4.1, the class Num a had a restriction Eq a , so any Num a also had Eq a . Floating a has a restriction of Num a , so all Floating a also had Eq a .
However, this changed in 7.4.1, where the Eq a constraint (as well as the Show a constraint) was removed from the Num class. This is why the code no longer works.
So, the solution to the problem is exactly what the aylator gave: add the Eq a constraint explicitly to the VectorSpace class.
Alternatively, you can download an older version of ghc (e.g. 6.8 based on wiki notes). This version should compile the program without any changes. You can then update the code to make it work with a newer version of ghc if you want to.
source share