
23 Jan
2009
23 Jan
'09
7:25 p.m.
2009/1/23 Austin Seipp
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-extension...
--
Dave Menendez