Proposal: Turn on ScopedTypeVariables by default

I know this will be controversial, because it can break (weird) code and because it's not Haskell 2010, but hey, you can't make brain salad without breaking a few heads. ScopedTypeVariables is just awesome for two fundamental reasons: 1. It lets you write type signatures for more things. 2. It lets you write more precise type signatures for many things. As a consequence of those two, 3. It helps you get much better error messages from the type checker. And for all that, 4. It's really easy to use. What do other people think?

I have often thought the same thing. This is probably the language
extension I enable the most... a quick grep shows about 40% of my
modules.
I'm guessing the problem is that its not Haskell 98/2010? I think GHC
has a policy to do only what the spec says by default. Is that still
true now that AMP is implemented?
You could just always include it in the 'extensions' field of your
cabal file. Then it will apply to your whole project.
On Mon, Feb 23, 2015 at 11:45 AM, David Feuer
I know this will be controversial, because it can break (weird) code and because it's not Haskell 2010, but hey, you can't make brain salad without breaking a few heads. ScopedTypeVariables is just awesome for two fundamental reasons:
1. It lets you write type signatures for more things. 2. It lets you write more precise type signatures for many things.
As a consequence of those two,
3. It helps you get much better error messages from the type checker.
And for all that,
4. It's really easy to use.
What do other people think?
_______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

On Mon, Feb 23, 2015 at 12:59 PM, Andrew Farmer
I'm guessing the problem is that its not Haskell 98/2010? I think GHC has a policy to do only what the spec says by default. Is that still true now that AMP is implemented?
I think the main worry is that it steals syntax, specifically the `forall` keyword, which is just an identifier in H'98 and H'2010. (And some bikeshedding over `forall` being inappropriate for this use, but I suspect that ship sailed long ago.) -- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net

Brandon Allbery wrote:
On Mon, Feb 23, 2015 at 12:59 PM, Andrew Farmer
wrote: I'm guessing the problem is that its not Haskell 98/2010? I think GHC has a policy to do only what the spec says by default. Is that still true now that AMP is implemented?
I think the main worry is that it steals syntax, specifically the `forall` keyword, which is just an identifier in H'98 and H'2010. (And some bikeshedding over `forall` being inappropriate for this use, but I suspect that ship sailed long ago.)
The real problem with this syntax is the irregular and completely unnecessary overloading of the dot. As if the dot weren't overloaded enough! A much better choice would have been forall a b c in ... This could still be changed: we could have both variants in parallel for a while, then slowly deprecate the dot and finally scrap it. Cheers Ben -- "There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult." ― C.A.R. Hoare

On 15-02-23 12:45 PM, David Feuer wrote:
I know this will be controversial, because it can break (weird) code and because it's not Haskell 2010, but hey, you can't make brain salad without breaking a few heads. ScopedTypeVariables is just awesome for two fundamental reasons:
1. It lets you write type signatures for more things. 2. It lets you write more precise type signatures for many things.
As a consequence of those two,
3. It helps you get much better error messages from the type checker.
And for all that,
4. It's really easy to use.
What do other people think?
I'd love this to happen, but not before it was specified in the next Haskell standard.
participants (5)
-
Andrew Farmer
-
Ben Franksen
-
Brandon Allbery
-
David Feuer
-
Mario Blažević