Re: Updating/understanding code from implicit configurations paper

2013-01-18 Thread Eric M. Pashman
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 wrote: > On Fri, Jan 18, 2013 at 3:32 PM, Eric M. Pashman > wrote: >> >>normaliz

Re: Updating/understanding code from implicit configurations paper

2013-01-18 Thread Shachaf Ben-Kiki
On Fri, Jan 18, 2013 at 3:32 PM, Eric M. Pashman 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

Updating/understanding code from implicit configurations paper

2013-01-18 Thread Eric M. Pashman
Reading the implicit configurations paper (Kiselyov & Shan), I couldn't figure out how this bit of code (section 3.2) was meant to work: class Modular s a | s -> a where modulus :: s -> a normalize :: (Modular s a, Integral a) => a -> M s a normalize a :: M s a = M (mod a (modulus (u