Opened 6 months ago

Closed 5 months ago

Last modified 5 months ago

#13781 closed bug (fixed)

(a :: (k :: Type)) is too exotic for Template Haskell

Reported by: RyanGlScott Owned by: RyanGlScott
Priority: normal Milestone: 8.4.1
Component: Template Haskell Version: 8.0.1
Keywords: TypeInType Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: GHC rejects valid program Test Case: T13781
Blocked By: Blocking:
Related Tickets: Differential Rev(s): Phab:D3627
Wiki Page:

Description

On GHC 8.0.1 or later, GHC will choke on this code:

{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeInType #-}
module Bug where

import Data.Kind
import Data.Proxy

$([d| f :: Proxy (a :: (k :: Type))
      f = Proxy
    |])
GHCi, version 8.2.0.20170522: http://www.haskell.org/ghc/  :? for help
Loaded GHCi configuration from /home/rgscott/.ghci
[1 of 1] Compiling Bug              ( Bug.hs, interpreted )

Bug.hs:8:3: error:
    Exotic form of kind not (yet) handled by Template Haskell
      (k :: Type)
  |
8 | $([d| f :: Proxy (a :: (k :: Type))
  |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...

I don't think this would be too hard to support, though. I'll take a shot at fixing this.

Change History (5)

comment:1 Changed 6 months ago by RyanGlScott

Owner: set to RyanGlScott

comment:2 Changed 6 months ago by RyanGlScott

Differential Rev(s): Phab:D3627
Status: newpatch

comment:3 Changed 5 months ago by Ben Gamari <ben@…>

In 9a3ca8de/ghc:

Support signatures at the kind level in Template Haskell

`repNonArrowKind` was missing a case for `HsKindSig`, which this
commit adds. Fixes #13781.

Test Plan: make test TEST=T13781

Reviewers: goldfire, austin, bgamari

Reviewed By: goldfire

Subscribers: rwbarton, thomie

GHC Trac Issues: #13781

Differential Revision: https://phabricator.haskell.org/D3627

comment:4 Changed 5 months ago by bgamari

Milestone: 8.4.1
Resolution: fixed
Status: patchclosed

comment:5 Changed 5 months ago by bgamari

Test Case: T13781
Note: See TracTickets for help on using tickets.