{-
must work.
However, there is one mistake, and this is really true if this instance must be defined in the library. Lexeme will create an instance of Typeable , and if any other library includes a similar instance, there will be a conflict. Unfortunately, all you can really do to not add a global instance of Typeable Lexeme is either to hope that it will be added to the base at some point, or to use the newtype wrapper and manually wrap and deploy Lexeme .
newtype LexemeWrapper = WrapLexeme { unwrapLexeme :: Lexeme } deriving Typeable
source share