[ghc-steering-committee] #216: Qualified Do again, recommendation: accept the alternative

Simon Peyton Jones simonpj at microsoft.com
Fri May 8 22:40:29 UTC 2020


Hmm.  I can see the attraction of using other less widely used names like
	M.qualifiedDoBind
	M.qualifiedDoFail
	M.qualifedDoMFix

Then searching for `qualifiedDo` would find the things that are used for, well qualified do.  Remember, by using the module-prefix form we are making it harder to group together the operations that make up the things used by qualified do -- (>>), (>>=) etc are among the most widely used lexemes in Haskell.

I'm not immovable on this, but I think there's a case for using long, explicit names.  If you end up saying
	qualifiedDoBind = (>>=)
that would be a very good clue that you intend this operation to be used by Qualified Do.

Simon

| -----Original Message-----
| From: ghc-steering-committee <ghc-steering-committee-bounces at haskell.org>
| On Behalf Of Joachim Breitner
| Sent: 08 May 2020 23:02
| To: ghc-steering-committee at haskell.org
| Subject: Re: [ghc-steering-committee] #216: Qualified Do again,
| recommendation: accept the alternative
| 
| Hi,
| 
| Am Mittwoch, den 06.05.2020, 16:28 +0200 schrieb Joachim Breitner:
| > Hi,
| >
| > Am Mittwoch, den 06.05.2020, 15:55 +0200 schrieb Spiwack, Arnaud:
| > > There is one question to solve: should we use the standard names
| > > `(>>=)`, `(>>)` for desugaring? (so that the type class methods can
| > > be used directly). Or some dedicated names `desugaringBind`, … ? To
| > > avoid name clashes.
| >
| > given that the recommended idiom is to only use this with a qualified
| > module name, I think using the normal, well-known names is reasonable.
| 
| 
| do we have more opinions on this? If not we can go with the author’s
| proposal, which is to use the standard names. It’s natural that when I can
| write `M.do { a M.>> b ; c }` after all, and helpful if programmer can
| expect M.>> to be there for every module M that they would use to qualify
| `do`.
| 
| 
| Cheers,
| Joachim
| --
| Joachim Breitner
|   mail at joachim-breitner.de
|   http://www.joachim-breitner.de/
| 
| 
| _______________________________________________
| ghc-steering-committee mailing list
| ghc-steering-committee at haskell.org
| https://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-steering-committee


More information about the ghc-steering-committee mailing list