19 Jan
2013
19 Jan
'13
12:13 a.m.
Whoops. I forgot you need the explicit `forall` with scoped type variables. I thought there was something much more involved going on here. Thanks, Shachaf. Eric On Jan 18, 2013, at 17:54 , Shachaf Ben-Kiki <shachaf@gmail.com> wrote:
On Fri, Jan 18, 2013 at 3:32 PM, Eric M. Pashman <eric.pashman@gmail.com> wrote:
normalize :: (Modular s a, Integral a) => a -> M s a normalize x = (M (mod x (modulus (undefined :: s)))) :: M s a
If you want your type variables to be scoped, you have to annotate them explicitly:
normalize :: forall s a. (Modular s a, Integral a) => a -> M s a normalize x = M (mod x (modulus (undefined :: s)))
Shachaf