Skip to content

Type family not reduced, again

This one looks similar to #12381 (closed), but unfortunately, it does not seem to be fixed in HEAD:

{-# LANGUAGE TypeInType, TypeFamilies, FlexibleInstances #-}

import GHC.Types

type family F (a :: Type) :: Type

class C a where
  type D (a :: Type) :: F a

instance (F a ~ Bool) => C a where
  type D a = True

This yields (in 8.0.1 and 8.1.20160709):

Constraint.hs:11:14: error:
    • Expected kind ‘F a’, but ‘'True’ has kind ‘Bool’
    • In the type ‘True’
      In the type instance declaration for ‘D’
      In the instance declaration for ‘C a’
Edited by Andres Löh
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information