
On Dec 8, 2020, at 4:32 AM, Joachim Breitner
wrote: Would you argue that it should not be included even _if_ we’d include GADTs and/or TypeFamilies? Or are you saying that MonoLocalBinds shouldn’t be in; GADTS/TypeFamilies are bad without MonoLocalBinds, and thus GADTs/TypeFamilies ought to be left out?
No. If we have GADTs and/or TypeFamilies, then we should absolutely have MonoLocalBinds -- GADTs and TypeFamilies are wonky without MonoLocalBinds. I'd prefer not to have any of them on by default.
On Dec 8, 2020, at 10:36 AM, Eric Seidel
wrote:
Aha, so what you're saying is that with NamedWildCards but not PartialTypeSignatures, GHC will tell you what `_a` was solved for, but it won't accept the resulting program? I didn't realize that NamedWildCards did anything in the absence of PartialTypeSignatures, but I agree that this is better. I was already voting for NamedWildCards, but now I'm inclined to additionally vote against PartialTypeSignatures.
Exactly, yes. I am strongly against PartialTypeSignatures as an extension, as users should have to opt into accepting partially-written programs.
On Dec 8, 2020, at 11:59 AM, Iavor Diatchki
wrote: It seems odd to turn on an extension [NamedWildCards] that doesn't do anything, and it is entirely there to make *another* extension work better? Wouldn't it be better to make `PartialTypeSignatures` imply `NamedWildCards`?
NamedWildCards *does* do something on its own -- it just doesn't accept new programs. If we consider
foo :: _a -> _a foo True = False foo False = True
Without NamedWildCards, we get
Bug.hs:4:5: error: • Couldn't match expected type ‘_a’ with actual type ‘Bool’ ‘_a’ is a rigid type variable bound by the type signature for: foo :: forall _a. _a -> _a at Bug.hs:3:1-15 • In the pattern: True In an equation for ‘foo’: foo True = False • Relevant bindings include foo :: _a -> _a (bound at Bug.hs:4:1)
With NamedWildCards, we get
Bug.hs:5:8: error: • Found type wildcard ‘_a’ standing for ‘Bool’ To use the inferred type, enable PartialTypeSignatures • In the type signature: foo :: _a -> _a
I think that prefixing a variable name with an underscore is a convenient, lightweight way of asking GHC to tell me what a type should be. Richard