Subject: Re: AT solution: rebinding >>= for restricted monads Newsgroups: gmane.comp.lang.haskell.cafe Date: Tuesday 19th December 2006 15:08:12 UTC (over 11 years ago) David Roundy wrote: > The trouble is that your solution doesn't allow you to use do-notation with > the IxMonad. And if you did allow yourself to use do-notation by rebinding > (>>=), etc, then you wouldn't be able to use ordinary monads with > do-notation in the same module. That's what makes things tricky, since an > IxMonad is different-kinded from Monad, so you can't make a monad an > instance of IxMonad. > Seems to me that this screams for camlp4. Oops, wrong language ;-) But seriously, this kind of thing seems to arise often enough that having a standard method for doing "syntax extensions" for Haskell seems like a good idea. And as far as making Monad instances for IxMonad, this is where partial application at the class level would come in rather handy. Seems to be that (at least) IxMonad m () () should be a Monad. Jacques |
|||