Opened 2 years ago

Last modified 2 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 Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

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 2 years ago by simonpj

  • Difficulty set to Unknown
  • Milestone set to _|_
  • Priority changed from normal to low

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.

Simon

Note: See TracTickets for help on using tickets.