Skip to content

Variant of makeClosedAlpha that works for type constructors. #12

@lambdageek

Description

@lambdageek

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)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions