[ghc-steering-committee] Discussion on proposal #99: forall {k}

Richard Eisenberg rae at cs.brynmawr.edu
Wed May 2 18:10:19 UTC 2018


OK -- I could agree with forbidding braces on `data` (given that the GADT-syntax alternative exists), but what about `class`? And then if we allow it on `class`, it seems a bit silly not to do the analogous thing on `data`. (Note that the proposal currently describes the same scheme as I have described in this email thread, but only about `class`.)

Richard

> On May 2, 2018, at 9:48 AM, Joachim Breitner <mail at joachim-breitner.de> wrote:
> 
> Hi,
> 
> Am Dienstag, den 01.05.2018, 22:05 -0400 schrieb Richard Eisenberg:
>> We can boil it down to one rule for these situations:
>> RULE. Braces used in type declarations affect only the types of
>> terms declared within the declaration. The braces have no effect
>> whatsoever on the kind of the type(s) declared.
>> 
>> With this in mind, I'll answer the questions below:
>> 
>>> On May 1, 2018, at 12:56 PM, Iavor Diatchki <iavor.diatchki at gmail.c
>>> om> wrote:
>>> 
>>> -- 1) The "normal" case.  I've written the types of the introduces names underneath, are they correct?
>>> data T1 {k} (a :: k) = C1
>>> -- T1 :: forall {k::Type}. k -> Type
>>> -- C1 :: forall {k::Type} (a :: k). T1 {k} a
>> 
>> I would say we get
>> 
>> T1 :: forall (k :: Type) -> k -> Type    -- T1 has *2* visible arguments
>> C1 :: forall {k :: Type} (a :: k). T1 k a   -- C1 has one inferred and one specified type argument
> 
> 
> I think this is highly confusing. The {k} is on T1, but it does not
> affect T1, but rather something else?
> 
> What is wrong with “if you want to have different specificity on the
> tycon and the datacon, use GADTSyntax”?
> 
> Cheers,
> Joachim
> -- 
> Joachim Breitner
>  mail at joachim-breitner.de
>  http://www.joachim-breitner.de/
> _______________________________________________
> ghc-steering-committee mailing list
> ghc-steering-committee at haskell.org
> https://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-steering-committee



More information about the ghc-steering-committee mailing list