On Wed, Jul 27, 2011 at 6:13 AM, Ben Lippmeier <[email protected]> wrote:
> Yes, that is a problem. I was thinking we we should use plain 'do' for the
> imperative do, and 'mdo' for the monadic one, but I didn't finish
> implementing this. I'm open to suggestions.
I'd call the imperative one "seq" and the monadic one "do", but this
is not so "natural-language-like" or whatever. Don't know really. (May
still implement either of these in the meantime.)
>> It's
>> not obvious what was intented from the current parser; it even allows
>> (or rather would allow if parsing "x <- foo" really worked) "instance
>> Monad Foo where { return <- undefined }" which is complete nonsense.
>
> This is actually ok, because 'return' isn't a keyword. The return function is
> defined as a regular binding, and presuming you allow variable shadowing you
> can redefine its meaning locally.
Sure; it is the (<-) binding in an instance declaration which is strange.
> Whether we allow a monadic bind as the last statement in a do-block is a
> separate decision.
Why would we want to?
Alex
--
Disciple-Cafe mailing list
http://groups.google.com/group/disciple-cafe