Hello,
as the Github discussion is pretty long, I thought it might be useful to have a summary of the observations to the issue being discussed, namely how to resolve the names in `M.do`.
Without the special syntax suggested by Joachim, a programmer has the following options to make `M.do` work, and I've marked some (potential) pros/cons:
1. import MyMonad as M
(+) other operations do not need to be qualified
(-) unqualified `>>=` may be ambiguous
2. import qualified MyMonad as M
(-) other operations need to be qualified
(+) unqualified `>>=` is not ambiguous
3. import qualified MyMonas as M
import MyMonad (other,operations)
(+) other operations do not need to be qualified
(+) unqualifed `>>=` is not ambiguous
(-) requires two imports
Joachim's proposal aims to improve on (3) by allowing programmers to write:
4. import MyMonad as M (other,operations)
(+) other operations do not need to be qualified
(+) unqualified `>>=` are not ambiguous
The idea is that the renamer would compute the original name to use in the desugaring by seeing if `>>=` is exported by one of the modules imported with alias `M`. GHC certainly has the required information, and I doubt this would be hard to implement.
As I said in my previous e-mail, I don't have a strong feeling about the choice we make, but I wanted to make sure that we are all discussing the same thing.
-Iavor