jgm/pandoc-types

instacne ToMetaValue String in v1.17.5 is useless as it is

Closed this issue · 0 comments

instance ToMetaValue String where
toMetaValue = MetaString

I've been defining a similar instance in pandoc-crossref for a while now. Now I can't due to duplicate instances. But the instance defined here is pretty useless too, because trying to use it will fail every time due to overlapping instances:

    • Overlapping instances for ToMetaValue [Char]
      Matching instances:
        instance ToMetaValue String -- Defined in ‘Text.Pandoc.Builder’
        instance ToMetaValue a => ToMetaValue [a]
          -- Defined in ‘Text.Pandoc.Builder’

Consider adding an {-# OVERLAPPING #-} pragma:

instance {-# OVERLAPPING #-} ToMetaValue String where
  toMetaValue = MetaString

otherwise, it's very problematic for me and in general.