Opened 5 years ago

Last modified 5 years ago

#6034 new bug

Parse error when using ' with promoted kinds

Reported by: goldfire Owned by:
Priority: low Milestone:
Component: Compiler (Parser) Version: 7.5
Keywords: DataKinds Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: GHC rejects valid program Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


The following code generates a parse error:

{-# LANGUAGE DataKinds #-}

data Proxy a = Proxy
foo :: Proxy '['[True, False],'[False]]
foo = Proxy

The problem is that the '[' prefix to the type index is parsed as a character. Rewriting that string as '[ ' fixes the problem.

This is admittedly a very low priority problem, but it seemed to be enough of an infelicity to be worth reporting.

This was tested on 7.5.20120420.

Change History (1)

comment:1 Changed 5 years ago by simonpj

difficulty: Unknown
Milestone: _|_
Priority: normallow

Right. Indeed I could imagine character literals at the type level (although we don't have them at the moment. So I'm guessing that

foo :: Proxy '[ '[True, False],'[False] ]

would be something to encourage. It's a shortcoming of the quote syntax to be sure.


Note: See TracTickets for help on using tickets.