Skip to content

Deriving tagged instances requires PolyKinds #6

Open
@aherrmann

Description

@aherrmann

Deriving tagged instances requires the PolyKinds or TypeInType extension to be enabled. E.g. the following code

newtype MyState a = MyState (State Int a)
  deriving (Functor, Applicative, Monad)
  deriving (HasState "foo" Int) via
    MonadState (State Int)

raises compiler errors of the form

    Illegal kind: ([] :: [] ghc-prim-0.5.3:GHC.Types.RuntimeRep)
    Did you mean to enable PolyKinds?

This is likely due to the use of Proxy# in HasState's methods. #15073 might be related.

Having to enable PolyKinds can be a nuisance, because it may require the user to provide additional kind signatures in the affected module. See #4 (comment).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions