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

Spiwack, Arnaud arnaud.spiwack at tweag.io
Tue Apr 14 06:58:40 UTC 2020


On Fri, Apr 10, 2020 at 10:43 AM Joachim Breitner <mail at joachim-breitner.de>
wrote:

> I am surprised this is so controversial. There are many things in
> Haskell that are used that are not imported:
>
>  * The desugaring of plain do notation (!)
>  * The desugaring of if-then-else (no need to have True/False in scope)
>  * The desugaring of boolean guards
>    (again, no need to have True/False in scope)
>  * Instances
>  * And because of that, `foo.bar` according to RecordDotSyntax will
>    not require `bar` to be in scope, as this is just an
>    instance accessed via HasField "bar" (if I am not mistaken)
>
> In contrast, there is nothing where you have to import some `foo` when
> you don't actually mention `foo` in your source code.
>
> Which seems a pretty reasonable rule:
> Import the things you write; no more, no less!
>

I wanted to add, for the record, that Joachim's argument convinced me that,
indeed, were we to go for the module-qualified do approach, we probably
shouldn't require the names to be in scope.

However, it makes the module-qualified approach more counter-intuitive to
me: it doesn't make sense to me to use the namespace `M` to refer to a term
which is not in this namespace. Obviously, Joachim, you have a different
intuition about this.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-steering-committee/attachments/20200414/7d496a7b/attachment-0001.html>


More information about the ghc-steering-committee mailing list