[Haskell-cafe] RebindableSyntax on individual do blocks
Sumit Sahrawat, Maths & Computing, IIT (BHU)
sumit.sahrawat.apm13 at iitbhu.ac.in
Mon Jun 22 18:56:36 UTC 2015
I don't know anything about indexed monads, but it seems that you can use
the 'where' keyword to rebind (>>) and return for any block you want .
An example from :
addNumbers = do
where (>>) = (+)
It might be possible to generate this where block using TH.
There is also a quasi-quoter available for indexed-do-notation .
On 23 June 2015 at 00:09, Mark Roberts <markandrusroberts at gmail.com> wrote:
> I have a program that uses both monads and indexed monads, and I'd like to
> use do-notation for each in the same source file. Is there a way to rebind
> syntax for only the do blocks that make use of an indexed monad?
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe