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

Variant of makeClosedAlpha that works for type constructors. #12

Open
lambdageek opened this issue Apr 16, 2015 · 0 comments
Open

Variant of makeClosedAlpha that works for type constructors. #12

lambdageek opened this issue Apr 16, 2015 · 0 comments

Comments

@lambdageek
Copy link
Owner

So we can do

  data T = A | B | C deriving (Eq, Ord, Show)
  $(makeClosedAlpha ''T)

but we could also want

  data T a where
    A :: Int -> T Int
    B :: Bool -> T Bool
    C :: Char -> T Char
  deriving instance Eq (T a)
  deriving instance Ord (T a)
  deriving instance Show (T a)
  $(makeClosedAlpha ''T)

which doesn't work right now because it makes the following instance declaration

  instance Alpha T

instead of the kind-correct

  instance Alpha (T a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant