serokell / universum

:milky_way: Prelude written in @Serokell
MIT License
176 stars 26 forks source link

Rewrite rules for `toString`/`toText` #212

Closed Martoon-00 closed 5 years ago

Martoon-00 commented 5 years ago

Problem: we consider using Text everywhere a good practice, but many libraries use String instead, and some function may perform toString just to scan/modify text contents. This may cause unnecessary toText followed by toString conversions.

Solution: add rewrite rules for this case.

Probably toString . (fromString :: String -> Text) case would be also interesting.