Generalizing from a specific type to a class in a GADT
问题 I have the following definitions {-# LANGUAGE GADTs, TypeInType, RankNTypes #-} import Data.Kind class Character (a :: * -> *) where showVal :: a b -> b -> String data ExampleCharacter a where Variable :: ExampleCharacter String EqualSign :: ExampleCharacter () Deref :: ExampleCharacter () instance Character ExampleCharacter where showVal Variable = id showVal EqualSign = const "=" showVal Deref = const "*" data Symbol :: forall a. ExampleCharacter a -> * where Terminal :: a -> Symbol (b ::