Re: Use of forall as a sigil

Hi Richard,
In the end, I've never loved the forall ... -> syntax, but I've never seen anything better.
What about the forall @a. syntax? For example: sizeOf :: forall @a. Sized a => Int We already use @ to explicitly specify types, so it seems natural mark type parameters that must be explicitly specified with @ too. Here's how one would read it: "for all explicitly specified a, ..." Apologies if this has been discussed and I missed it. It doesn't seem to be mentioned in the Alternatives section of the proposal but perhaps it will just never work for some reason. Cheers, Andrey

I have thought about this too, and don't believe it has been widely discussed. - We are already getting `forall {a}.`, so it fits nicely with that. - However, it would have to be `forall @a ->`, because `forall a.` is already an invisible quantification, unless one wants to just change the meaning of `forall a.`! John On 11/22/20 6:23 AM, Andrey Mokhov wrote:
Hi Richard,
In the end, I've never loved the forall ... -> syntax, but I've never seen anything better. What about the forall @a. syntax?
For example:
sizeOf :: forall @a. Sized a => Int
We already use @ to explicitly specify types, so it seems natural mark type parameters that must be explicitly specified with @ too.
Here's how one would read it: "for all explicitly specified a, ..."
Apologies if this has been discussed and I missed it. It doesn't seem to be mentioned in the Alternatives section of the proposal but perhaps it will just never work for some reason.
Cheers, Andrey
_______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

Hi John,
- We are already getting `forall {a}.`, so it fits nicely with that.
Interesting, I wasn't aware of this. Could you point me to the relevant proposal?
- However, it would have to be `forall @a ->`,
Oh, that seems even worse than `forall a ->` to me.
because `forall a.` is already an invisible quantification, unless one wants to just change the meaning of `forall a.`!
I'm confused. I wasn't suggesting to change the meaning of `forall a.`.
My suggestion was pretty incremental:
* `forall a.` stays as is: it allows for both invisible and visible type arguments.
* `forall @a.` requires a visible type argument.
Cheers,
Andrey
-----Original Message-----
From: John Ericson [mailto:john.ericson@obsidian.systems]
Sent: 22 November 2020 16:41
To: Andrey Mokhov

For me, the problem with `forall @a .` is that it seems to go in the wrong direction: parameters declared with @ must not have @ when passed, and parameters declared without @ must have a @ if the parameter is passed explicitly. However, if we say that @ makes a thing that is normally implicit explicit, maybe it works? Richard
On Nov 22, 2020, at 3:03 PM, Andrey Mokhov
wrote: Hi John,
- We are already getting `forall {a}.`, so it fits nicely with that.
Interesting, I wasn't aware of this. Could you point me to the relevant proposal?
- However, it would have to be `forall @a ->`,
Oh, that seems even worse than `forall a ->` to me.
because `forall a.` is already an invisible quantification, unless one wants to just change the meaning of `forall a.`!
I'm confused. I wasn't suggesting to change the meaning of `forall a.`.
My suggestion was pretty incremental:
* `forall a.` stays as is: it allows for both invisible and visible type arguments. * `forall @a.` requires a visible type argument.
Cheers, Andrey
-----Original Message----- From: John Ericson [mailto:john.ericson@obsidian.systems] Sent: 22 November 2020 16:41 To: Andrey Mokhov
; Richard Eisenberg Cc: ghc-devs@haskell.org Subject: Re: Use of forall as a sigil I have thought about this too, and don't believe it has been widely discussed.
- We are already getting `forall {a}.`, so it fits nicely with that.
- However, it would have to be `forall @a ->`, because `forall a.` is already an invisible quantification, unless one wants to just change the meaning of `forall a.`!
John
participants (3)
-
Andrey Mokhov
-
John Ericson
-
Richard Eisenberg