Skip to content

Type family not reduced

Andres pointed out that the following fails to compile with GHC 8.0.1 but succeeds with master (f53d761d),

{-# LANGUAGE TypeInType, TypeFamilies #-}
module Kinds where

import GHC.Types

type family G (a :: Type) :: Type
type instance G Int = Bool

type family F (a :: Type) :: G a
type instance F Int = True

Error:

Hi.hs:10:23: error:
    • Expected kind ‘G Int’, but ‘'True’ has kind ‘Bool’
    • In the type ‘True’
      In the type instance declaration for ‘F’

We should figure out what fixed this so it can hopefully be merged for 8.0.2. I initially suspected the patch cited in #12175 (closed) but sadly this doesn't seem to be the case.

Trac metadata
Trac field Value
Version 8.0.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler (Type checker)
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information