Restricting string literals to Text only

前端 未结 2 1808
悲哀的现实
悲哀的现实 2021-02-03 18:33

I\'m aware that the OverloadedStrings language pragma wraps an implicit fromString around all string literals. What I\'d like to do is not actually

2条回答
  •  一个人的身影
    2021-02-03 19:18

    Not a way to achieve this now, but maybe eventually, is the instance force as proposed in a GHC feature proposal under discussion, where you’d say

    instance force IsString Text
    

    in your module. This is one of the main motivating examples for the proposal.

提交回复
热议问题