[Haskell-cafe] Syntax of 'do'
Philip Weaver
philip.weaver at gmail.com
Fri Aug 29 23:22:23 EDT 2008
On Fri, Aug 29, 2008 at 8:50 AM, David House <dmhouse at gmail.com> wrote:
> 2008/8/29 Philip Weaver <philip.weaver at gmail.com>:
> > It sounds like you tried to redefine (>>) and (>>=) and make 'do' use the
> > new definitions. This is not possible, regardless of what types you give
> > (>>) and (>>=).
>
> Watch out for rebindable syntax:
>
> http://www.haskell.org/ghc/docs/latest/html/users_guide/syntax-extns.html#rebindable-syntax
>
Oh, I had no idea! Thanks :).
>
> At first reading, I thought that -XNoImplicitPrelude was required to
> turn this on. But now I'm not sure: it seems that if you hide
> Prelude.>>= and Prelude.return, that ought to be enough to make do
> notation work with your alternative definitions. I'm not at home, so I
> can't try this right now.
>
> --
> -David
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20080829/e8455db4/attachment.htm
More information about the Haskell-Cafe
mailing list