Getting a Typeable instance for (':)

I'm trying to get a Typeable instance for (':)

I am using DataKinds and [*].

I have TypeOperators, StandaloneDeriving and PolyKinds enabled

I cannot get an instance like

I tried

deriving instance Typeable (':)

      

and

deriving instance Typeable ':

      

and

deriving instance Typeable ((':))

      

but they all get parsing errors.

I know that if I write

data List a = Cons a (List a) | Empty

deriving instance Typeable (Cons)

      

I get the expected result, but I don't want to rewrite my existing code to use my own list type.

+3


source to share


1 answer


It seems to work

 deriving instance Typeable '(:)

      



Presumably '

intended to mean a "full type constructor", including if it's stripped? Seems a little odd to me. This is consistent with tuples, however where you write

'(a, b)

      

+8


source







All Articles