“Illegal instance declaration” when declaring instance of IsString

后端 未结 2 561
天涯浪人
天涯浪人 2020-12-08 10:16

I\'m writing an application that uses UTF-16 strings, and to make use of the overloaded strings extension I tried to make an IsString instance for it:



        
2条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-08 10:16

    Why is this rejected?

    Because:

      (All instance types must be of the form (T a1 ... an)
       where a1 ... an are *distinct type variables*,
       and each type variable appears at most once in the instance head.
    

    Is there something I've missed?

    Yes:

       Use -XFlexibleInstances if you want to disable this.)
    

提交回复
热议问题