Skip to content

`UnliftedNewtypes` break the fix to T12369

Summary

UnliftedNewtypes break the fix to #12369 (closed)

See also #25593

Steps to reproduce

{-# language TypeFamilies, UnliftedNewtypes #-}
import Data.Kind
data family Fix :: (k -> *) -> k
newtype instance Fix f = In { out :: f (Fix f) }

result in

T12369.hs:4:38: error: [GHC-25897]
    • Couldn't match kind ‘t’ with ‘GHC.Types.LiftedRep’
      Expected a type, but ‘f (Fix f)’ has kind ‘*’
      ‘t’ is a rigid type variable bound by
        a family instance declaration
        at T12369.hs:4:1-48
    • In the type ‘f (Fix f)’
      In the definition of data constructor ‘In’
      In the newtype instance declaration for ‘Fix’
  |
4 | newtype instance Fix f = In { out :: f (Fix f) }

Expected behavior

The program should compile or atleast yield a more meaningful error.

Edited by Simon Peyton Jones
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information