error-messages icon indicating copy to clipboard operation
error-messages copied to clipboard

Suggest language extension for unlifted data family

Open monoidal opened this issue 3 years ago • 1 comments

When defining an unlifted datatype or newtype, GHC helpfully tells me Suggested fix: Perhaps you intended to use UnliftedNewtypes or UnliftedDatatypes. But this does not happen with data families, as can be tested by comparing the errors for A, B, C, D:

{-# LANGUAGE TypeFamilies, MagicHash, DataKinds #-}
module NT where

import GHC.Exts

{-
newtype A = MkA Int#

type B :: UnliftedType
data B = MkB
-}

data family C :: TYPE IntRep
newtype instance C = MkC Int#

data family D :: UnliftedType
data instance D = MkD

monoidal avatar Nov 03 '22 18:11 monoidal

I agree that this could be improved. There's not much to debate, so I'd say you can immediately open a GHC issue about this.

noughtmare avatar Nov 03 '22 20:11 noughtmare