[GHC] #13738: TypeApplications-related GHC internal error

GHC ghc-devs at haskell.org
Sun Aug 20 16:33:52 UTC 2017


#13738: TypeApplications-related GHC internal error
-------------------------------------+-------------------------------------
        Reporter:  RyanGlScott       |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.0.1
      Resolution:                    |             Keywords:
                                     |  TypeApplications
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Compile-time      |  Unknown/Multiple
  crash or panic                     |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #13985            |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by RyanGlScott):

 Another amusing workaround is that you can use a wildcard type in place of
 `k`:

 {{{#!hs
 {-# LANGUAGE PolyKinds #-}
 {-# LANGUAGE RankNTypes #-}
 {-# LANGUAGE ScopedTypeVariables #-}
 {-# LANGUAGE TypeApplications #-}
 module Bug where

 import Data.Coerce

 newtype Wrap f a = Wrap (f a)

 class C f where
   c :: f a

 instance C f => C (Wrap f) where
   c = coerce @(forall (a :: _). f a)
              @(forall (a :: _). Wrap f a)
       c
 }}}

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13738#comment:6>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list