Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggest language extension for unlifted data family #535

Open
monoidal opened this issue Nov 3, 2022 · 1 comment
Open

Suggest language extension for unlifted data family #535

monoidal opened this issue Nov 3, 2022 · 1 comment

Comments

@monoidal
Copy link
Member

monoidal commented Nov 3, 2022

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
@noughtmare
Copy link

noughtmare commented Nov 3, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants