24 Jan
2009
24 Jan
'09
12:25 a.m.
2009/1/23 Austin Seipp <mad.one@gmail.com>:
The code is attached to this message; the problem is in the normalize function:
normalize :: (Modular s a, Integral a) => a -> M s a normalize a = M (mod a (modulus (u :: s)))
"s" isn't scoped over the definition of "normalize" in this definition. You need an explicit "forall". normalize :: forall s a. (Modular s a, Integral a) => a -> M s a normalize a = M (mod a (modulus (u::s))) See section 8.8.6 of the GHC manual. <http://www.haskell.org/ghc/docs/latest/html/users_guide/other-type-extensions.html#scoped-type-variables> -- Dave Menendez <dave@zednenem.com> <http://www.eyrie.org/~zednenem/>