
Hi, Am Freitag, den 10.04.2020, 09:58 +0200 schrieb Spiwack, Arnaud:
I am, to be honest, very uncomfortable with the idea: if I explicitly didn't import something, I don't want it to be used in my program. A counter-argument is that types appear in desugared programs which were not imported, so maybe I'm overreacting. But I'm still uncomfortable.
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! (Ok, there is one thing that was added recently: With Coercible you need to import the data constructor to coerce under a type constructors. Which I am not fond of.) And note that you’d still be explicitly importing the module name, which is the only thing you’d write in your program. So you can’t claim you “didn’t import something”. And: The same question actually applies to the record variant as well!, If we’d go for the record variant, would you expect the user to write import Linear (builder) or import Linear (builder, BuilderRecord(..)) in order to use `Linear.builder.do {…}`?
And it doesn't look like it's less of a complication than the fully- settled business.
To me, it does. Significantly so. Cheers, Joachim -- Joachim Breitner mail@joachim-breitner.de http://www.joachim-breitner.de/