Re: Do notation for arbitrary monads

From: Jan Christiansen <jac_at_informatik.uni-kiel.de>
Date: Wed, 07 Sep 2011 10:08:53 +0200

On Sep 7, 2011, at 9:51 AM, Michael Hanus wrote:

> In the current implementation, desugaring comes after type checking
> and name resolution, so this is not so easy to do.
> On the other hand, I think this would not help so much
> since I often use custom monads in places where also
> the IO monad is present (e.g., in order to print the results).
> Thus, for custom monads I also use my versions of ">>=" etc
> without the do-notation.

How about qualifying the do, that is, using something like

  f x = MyModule.do
     y <- e
     return y

and using MyModule.(>>=) and MyModule.return to desugar MyModule.do? However, this solution is quite ad-hoc.

Cheers, Jan
_______________________________________________
curry mailing list
curry_at_lists.RWTH-Aachen.DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/curry
Received on Mi Sep 07 2011 - 13:40:19 CEST

This archive was generated by hypermail 2.3.0 : Do Feb 01 2024 - 07:15:10 CET