<div dir="ltr">Whereas I agree that ScopedTypeVariables may not be ideal in its current incarnation, I think we should include this one for a few reasons.<div><br></div><div>* It's used a lot, in fact it's one of the most popular extensions in the survey, while still being not that contentious. I think almost everybody enables it liberally.</div><div><br></div><div>* It doesn't do harm unless you add the explicit 'forall' in the type signatures.</div><div><br></div><div>* Right now, there's no other way to bring type variables into scope! It would be really weird if GHC2021 would have TypeApplications, but I need to enable an extension to refer to variables in scope.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">El jue, 3 dic 2020 a las 17:48, Richard Eisenberg (<<a href="mailto:rae@richarde.dev">rae@richarde.dev</a>>) escribió:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">Hi all,<br>
<br>
I'd like to make a small plea against ScopedTypeVariables.<br>
<br>
* First off, I love (most of) ScopedTypeVariables, and enable it liberally. It is a safe extension.<br>
<br>
* But I very much dislike the way it brings variables into scope from `forall`s. When I write<br>
<br>
> f :: forall a. a -> a<br>
> f x = (x :: a)<br>
<br>
I find it very odd that `a` is brought into scope in the body of f. Compare to<br>
<br>
> f :: (forall a. a -> a)<br>
> f x = (x :: a)<br>
<br>
where I have added parentheses to the type of f. Now `a` is not in scope in the body of f. That's bizarre.<br>
<br>
* Note that type signatures and function definitions can be arbitrarily separated in a file. Some programmers indeed prefer to do this, so that type signatures can all be in one place, forming an interface to the file. (I've even seen header files, included via CPP!) I'm not necessarily advocating for that style, but I can't quite say it's absurd. Our ML friends do this reflexively.<br>
<br>
* I'm hoping ScopedTypeVariables will lose this feature in the future. I've been meaning to propose such for some time. See <a href="https://github.com/ghc-proposals/ghc-proposals/pull/238#issuecomment-499572523" rel="noreferrer" target="_blank">https://github.com/ghc-proposals/ghc-proposals/pull/238#issuecomment-499572523</a>, which re-slices this cake.<br>
<br>
Thus, given the potential for change in the future, and some drawbacks of the extension as it currently stands, I think we should not enable it by default, making change harder in the future.<br>
<br>
Thanks,<br>
Richard<br>
_______________________________________________<br>
ghc-steering-committee mailing list<br>
<a href="mailto:ghc-steering-committee@haskell.org" target="_blank">ghc-steering-committee@haskell.org</a><br>
<a href="https://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-steering-committee" rel="noreferrer" target="_blank">https://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-steering-committee</a><br>
</blockquote></div>