diff --git a/hmatrix.cabal b/hmatrix.cabal
--- a/hmatrix.cabal
+++ b/hmatrix.cabal
@@ -1,5 +1,5 @@
 Name:               hmatrix
-Version:            0.17.0.1
+Version:            0.17.0.2
 License:            BSD3
 License-file:       LICENSE
 Author:             Alberto Ruiz
@@ -16,7 +16,7 @@
                     Code examples: <http://dis.um.es/~alberto/hmatrix/hmatrix.html>
 
 Category:           Math
-tested-with:        GHC==7.8
+tested-with:        GHC==8.0
 
 cabal-version:      >=1.8
 
diff --git a/src/Internal/Matrix.hs b/src/Internal/Matrix.hs
--- a/src/Internal/Matrix.hs
+++ b/src/Internal/Matrix.hs
@@ -5,6 +5,7 @@
 {-# LANGUAGE TypeOperators            #-}
 {-# LANGUAGE TypeFamilies             #-}
 {-# LANGUAGE ViewPatterns             #-}
+{-# LANGUAGE ConstrainedClassMethods  #-}
 
 
 
diff --git a/src/Internal/Modular.hs b/src/Internal/Modular.hs
--- a/src/Internal/Modular.hs
+++ b/src/Internal/Modular.hs
@@ -72,7 +72,7 @@
   where
     compare a b = compare (unMod a) (unMod b)
 
-instance (Real t, KnownNat m, Integral (Mod m t)) => Real (Mod m t)
+instance (Integral t, KnownNat m, Integral (Mod m t)) => Real (Mod m t)
   where
     toRational x = toInteger x % 1
 
