I am trying to derive a Typeable instance for (':)
I am using DataKinds and [*].
I have TypeOperators, StandaloneDeriving and PolyKinds enabled
I cannot derive an instance of typeable
I have tried
deriving instance Typeable (':)
and
deriving instance Typeable ':
and
deriving instance Typeable ((':))
but they all get parse errors.
I know that if I write
data List a = Cons a (List a) | Empty
deriving instance Typeable (Cons)
I get the expected outcome but I do not wish to rewrite my existing code to use a custom list type.
This seems to work
deriving instance Typeable '(:)
Presumably the ' is designed to mark the "whole type constructor", including if it's sectioned? Seems a bit weird to me. This is consistent with tuples however, where you would write
'(a, b)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With