
On Fri, Apr 10, 2020 at 10:43 AM Joachim Breitner
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.