#8706 closed bug (fixed)

Kind operators not parsed

Reported by: goldfire Owned by:
Priority: normal Milestone: 7.8.1
Component: Documentation Version: 7.8.1-rc1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Revisions:

Description

Take the following module:

{-# LANGUAGE DataKinds, TypeOperators, TypeFamilies #-}

data a + b = Inl a | Inr b

type family Foo :: Bool + Bool

HEAD produces

/Users/rae/temp/Bug.hs:5:25: parse error on input ‛+’

It seems that type operators promoted to kinds are not parsed correctly.

Change History (7)

comment:1 Changed 16 months ago by goldfire

  • Component changed from Compiler (Parser) to Documentation

Argh. Of course there can't be kind operators, because it would be impossible to parse them. For example, what does Foo * Bar mean? Is it Foo applied to * and Bar? Or is it * applied to Foo and Bar?

I will document this, but I don't like it.

comment:2 Changed 16 months ago by Richard Eisenberg <eir@…>

In 218dead0d85a136b5d5648e4d6c4c9cc9467eb45/ghc:

Fix #8706, documenting that type operators are not promoted.

comment:3 Changed 16 months ago by goldfire

  • Status changed from new to merge

comment:4 Changed 16 months ago by dreixel

Is * the only problem here? If so, can't we promote everything else, and just refuse to promote type constructor operators named *?

comment:5 Changed 16 months ago by goldfire

I do think that would work, but it seems a little unprincipled. And, it was a design decision I wasn't prepared to make without discussion.

My general thought is that we're (in my humble opinion) heading to a future where the kind parser and the type parser are no longer distinct, because types and kinds will no longer be distinct. What does parsing in that world look like? I don't know, but I think we should try to future-proof any decision made here.

comment:6 Changed 16 months ago by goldfire

  • Milestone set to 7.8.1
  • Version changed from 7.7 to 7.8.1-rc1

Putting on Austin's radar for 7.8.1.

comment:7 Changed 15 months ago by thoughtpolice

  • Resolution set to fixed
  • Status changed from merge to closed

Merged.

Note: See TracTickets for help on using tickets.