[GHC] #15552: Infinite loop/panic with an existential type.

GHC ghc-devs at haskell.org
Wed Aug 22 07:45:38 UTC 2018


#15552: Infinite loop/panic with an existential type.
-------------------------------------+-------------------------------------
        Reporter:  howtonotwin       |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.6.1
       Component:  Compiler          |              Version:  8.4.3
      Resolution:                    |             Keywords:  TypeInType,
                                     |  TypeFamilies
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Compile-time      |  Unknown/Multiple
  crash or panic                     |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #14723            |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by simonpj):

 It's not #15473.  Here's a slightly cut down version
 {{{
 {-# LANGUAGE DataKinds, ExistentialQuantification, GADTs, PolyKinds,
 TypeOperators #-}
 {-# LANGUAGE TypeInType, TypeFamilies #-}
 module T15552 where

 import Data.Kind

 data Elem :: k -> [k] -> Type

 data EntryOfVal (v :: Type) (kvs :: [Type]) where
   EntryOfVal :: forall (v :: Type) (kvs :: [Type]) (k :: Type).
                 Elem (k, v) kvs -> EntryOfVal v kvs

 type family EntryOfValKey (eov :: EntryOfVal v kvs) :: Type

 type family GetEntryOfVal (eov :: EntryOfVal v kvs) :: Elem (EntryOfValKey
 eov, v) kvs

 type family FirstEntryOfVal (v :: Type) (kvs :: [Type]) :: EntryOfVal v
 kvs where
   FirstEntryOfVal v (_ : kvs) = 'EntryOfVal (GetEntryOfVal
 (FirstEntryOfVal v kvs))
 }}}

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


More information about the ghc-tickets mailing list