#607: Amend #281 (visible forall) and #378 (Design of DH) to clarify treatment of term variables in types (rec: accept)

Dear Committee, Jakob Brünker has proposed #607, an amendment to proposals #281 (visible forall) and #378 (Design of DH). See the diff here: https://github.com/ghc-proposals/ghc-proposals/pull/607/files The amendment concerns type checking of term-level variables appearing in types, for example: f :: forall (a :: Bool) -> ... -- visible forall, `f` expects a type-level Bool g :: Bool -> ... -- ordinary arrow, `g` expects a term-level Bool g x = f x What should happen to `x`, bound as a term variable but used as a type? #378 "Design for Dependent Types" already has an answer to this question: treat `x` as a skolem. But there are two problems 1. #378 does not explain this design decision in sufficient detail. This led Simon to question its inclusion: "Does it have any value, really? Why not just reject?" 2. #281 follows this design in one section, saying "treated as a fresh skolem constant"; and rejects it in another section, saying "any uses of terms in types are ill-typed". There is a contradiction. The amendment addresses both issues as follows: 1. A new example is added to #378, explaining how treating `x` as a skolem is useful, but only if `foreach` is available (a retained quantifier that allows dependent pattern matching) 2. Contradiction in #281 is resolved in favor of rejecting any uses of terms in types as ill-typed, saving this feature for a future proposal. I recommend to accept. Please share your thoughts either here or directly on GitHub. Vlad

This seems highly uncontroversial to me. I'm happy to support the amendment.
On Tue, 29 Aug 2023 at 08:48, Vladislav
Dear Committee,
Jakob Brünker has proposed #607, an amendment to proposals #281 (visible forall) and #378 (Design of DH). See the diff here: https://github.com/ghc-proposals/ghc-proposals/pull/607/files
The amendment concerns type checking of term-level variables appearing in types, for example:
f :: forall (a :: Bool) -> ... -- visible forall, `f` expects a type-level Bool g :: Bool -> ... -- ordinary arrow, `g` expects a term-level Bool g x = f x
What should happen to `x`, bound as a term variable but used as a type? #378 "Design for Dependent Types" already has an answer to this question: treat `x` as a skolem. But there are two problems
1. #378 does not explain this design decision in sufficient detail. This led Simon to question its inclusion: "Does it have any value, really? Why not just reject?" 2. #281 follows this design in one section, saying "treated as a fresh skolem constant"; and rejects it in another section, saying "any uses of terms in types are ill-typed". There is a contradiction.
The amendment addresses both issues as follows:
1. A new example is added to #378, explaining how treating `x` as a skolem is useful, but only if `foreach` is available (a retained quantifier that allows dependent pattern matching) 2. Contradiction in #281 is resolved in favor of rejecting any uses of terms in types as ill-typed, saving this feature for a future proposal.
I recommend to accept. Please share your thoughts either here or directly on GitHub.
Vlad _______________________________________________ ghc-steering-committee mailing list ghc-steering-committee@haskell.org https://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-steering-committee
-- Arnaud Spiwack Director, Research at https://moduscreate.com and https://tweag.io.

I support.
Simon
On Tue, 29 Aug 2023 at 07:48, Vladislav
Dear Committee,
Jakob Brünker has proposed #607, an amendment to proposals #281 (visible forall) and #378 (Design of DH). See the diff here: https://github.com/ghc-proposals/ghc-proposals/pull/607/files
The amendment concerns type checking of term-level variables appearing in types, for example:
f :: forall (a :: Bool) -> ... -- visible forall, `f` expects a type-level Bool g :: Bool -> ... -- ordinary arrow, `g` expects a term-level Bool g x = f x
What should happen to `x`, bound as a term variable but used as a type? #378 "Design for Dependent Types" already has an answer to this question: treat `x` as a skolem. But there are two problems
1. #378 does not explain this design decision in sufficient detail. This led Simon to question its inclusion: "Does it have any value, really? Why not just reject?" 2. #281 follows this design in one section, saying "treated as a fresh skolem constant"; and rejects it in another section, saying "any uses of terms in types are ill-typed". There is a contradiction.
The amendment addresses both issues as follows:
1. A new example is added to #378, explaining how treating `x` as a skolem is useful, but only if `foreach` is available (a retained quantifier that allows dependent pattern matching) 2. Contradiction in #281 is resolved in favor of rejecting any uses of terms in types as ill-typed, saving this feature for a future proposal.
I recommend to accept. Please share your thoughts either here or directly on GitHub.
Vlad _______________________________________________ ghc-steering-committee mailing list ghc-steering-committee@haskell.org https://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-steering-committee

Hi, Am Dienstag, dem 29.08.2023 um 08:48 +0200 schrieb Vladislav:
2. Contradiction in #281 is resolved in favor of rejecting any uses of terms in types as ill-typed, saving this feature for a future proposal.
clearly a safe and conversative path forward; in support. Cheers, Joachim -- Joachim Breitner mail@joachim-breitner.de http://www.joachim-breitner.de/

Looks like an overall improvement to me. I’m in support.
On Tue, 29 Aug 2023 at 2:48 PM, Vladislav
Dear Committee,
Jakob Brünker has proposed #607, an amendment to proposals #281 (visible forall) and #378 (Design of DH). See the diff here: https://github.com/ghc-proposals/ghc-proposals/pull/607/files
The amendment concerns type checking of term-level variables appearing in types, for example:
f :: forall (a :: Bool) -> ... -- visible forall, `f` expects a type-level Bool g :: Bool -> ... -- ordinary arrow, `g` expects a term-level Bool g x = f x
What should happen to `x`, bound as a term variable but used as a type? #378 "Design for Dependent Types" already has an answer to this question: treat `x` as a skolem. But there are two problems
1. #378 does not explain this design decision in sufficient detail. This led Simon to question its inclusion: "Does it have any value, really? Why not just reject?" 2. #281 follows this design in one section, saying "treated as a fresh skolem constant"; and rejects it in another section, saying "any uses of terms in types are ill-typed". There is a contradiction.
The amendment addresses both issues as follows:
1. A new example is added to #378, explaining how treating `x` as a skolem is useful, but only if `foreach` is available (a retained quantifier that allows dependent pattern matching) 2. Contradiction in #281 is resolved in favor of rejecting any uses of terms in types as ill-typed, saving this feature for a future proposal.
I recommend to accept. Please share your thoughts either here or directly on GitHub.
Vlad _______________________________________________ ghc-steering-committee mailing list ghc-steering-committee@haskell.org https://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-steering-committee

Yes, in support. Thanks for the nice summary. Richard
On Aug 29, 2023, at 4:40 AM, Moritz Angermann
wrote: Looks like an overall improvement to me. I’m in support.
On Tue, 29 Aug 2023 at 2:48 PM, Vladislav
mailto:vlad.z.4096@gmail.com> wrote: Dear Committee, Jakob Brünker has proposed #607, an amendment to proposals #281 (visible forall) and #378 (Design of DH). See the diff here: https://github.com/ghc-proposals/ghc-proposals/pull/607/files https://github.com/ghc-proposals/ghc-proposals/pull/607/files
The amendment concerns type checking of term-level variables appearing in types, for example:
f :: forall (a :: Bool) -> ... -- visible forall, `f` expects a type-level Bool g :: Bool -> ... -- ordinary arrow, `g` expects a term-level Bool g x = f x
What should happen to `x`, bound as a term variable but used as a type? #378 "Design for Dependent Types" already has an answer to this question: treat `x` as a skolem. But there are two problems
1. #378 does not explain this design decision in sufficient detail. This led Simon to question its inclusion: "Does it have any value, really? Why not just reject?" 2. #281 follows this design in one section, saying "treated as a fresh skolem constant"; and rejects it in another section, saying "any uses of terms in types are ill-typed". There is a contradiction.
The amendment addresses both issues as follows:
1. A new example is added to #378, explaining how treating `x` as a skolem is useful, but only if `foreach` is available (a retained quantifier that allows dependent pattern matching) 2. Contradiction in #281 is resolved in favor of rejecting any uses of terms in types as ill-typed, saving this feature for a future proposal.
I recommend to accept. Please share your thoughts either here or directly on GitHub.
Vlad _______________________________________________ ghc-steering-committee mailing list ghc-steering-committee@haskell.org mailto:ghc-steering-committee@haskell.org https://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-steering-committee https://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-steering-committee _______________________________________________ ghc-steering-committee mailing list ghc-steering-committee@haskell.org https://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-steering-committee

Agreed, this looks sensible to me. Adam On 29/08/2023 23:57, Richard Eisenberg wrote:
Yes, in support. Thanks for the nice summary.
Richard
On Aug 29, 2023, at 4:40 AM, Moritz Angermann
mailto:moritz.angermann@gmail.com> wrote: Looks like an overall improvement to me. I’m in support.
On Tue, 29 Aug 2023 at 2:48 PM, Vladislav
mailto:vlad.z.4096@gmail.com> wrote: Dear Committee,
Jakob Brünker has proposed #607, an amendment to proposals #281 (visible forall) and #378 (Design of DH). See the diff here: https://github.com/ghc-proposals/ghc-proposals/pull/607/files https://github.com/ghc-proposals/ghc-proposals/pull/607/files
The amendment concerns type checking of term-level variables appearing in types, for example:
f :: forall (a :: Bool) -> ... -- visible forall, `f` expects a type-level Bool g :: Bool -> ... -- ordinary arrow, `g` expects a term-level Bool g x = f x
What should happen to `x`, bound as a term variable but used as a type? #378 "Design for Dependent Types" already has an answer to this question: treat `x` as a skolem. But there are two problems
1. #378 does not explain this design decision in sufficient detail. This led Simon to question its inclusion: "Does it have any value, really? Why not just reject?" 2. #281 follows this design in one section, saying "treated as a fresh skolem constant"; and rejects it in another section, saying "any uses of terms in types are ill-typed". There is a contradiction.
The amendment addresses both issues as follows:
1. A new example is added to #378, explaining how treating `x` as a skolem is useful, but only if `foreach` is available (a retained quantifier that allows dependent pattern matching) 2. Contradiction in #281 is resolved in favor of rejecting any uses of terms in types as ill-typed, saving this feature for a future proposal.
I recommend to accept. Please share your thoughts either here or directly on GitHub.
Vlad
-- Adam Gundry, Haskell Consultant Well-Typed LLP, https://www.well-typed.com/ Registered in England & Wales, OC335890 27 Old Gloucester Street, London WC1N 3AX, England

Hi, Am Dienstag, dem 29.08.2023 um 08:48 +0200 schrieb Vladislav:
I recommend to accept. Please share your thoughts either here or directly on GitHub.
all in support, merging. Cheers, Joachim -- Joachim Breitner mail@joachim-breitner.de http://www.joachim-breitner.de/
participants (7)
-
Adam Gundry
-
Arnaud Spiwack
-
Joachim Breitner
-
Moritz Angermann
-
Richard Eisenberg
-
Simon Peyton Jones
-
Vladislav