serokell / universum

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

Make `trace` non-polymorphic over its textual argument #204

Closed Martoon-00 closed 5 years ago

Martoon-00 commented 5 years ago

Current trace accepts Print s as to-be-printed text which is almost always inconvenient.

Common use cases of using trace:

In both of these cases a text put into trace has type IsString s => s, and compiler cannot infer s when trace is itself polymorphic over its first argument. Thus trace which accepts a text of specific type is more convenient.

Formatting libraries like fmt and formatting may provide a way to produce text of specifc type (like fmt combinators and operators produce Builder and sformat produces text), but it may be irritating to add imports for a temporal debugging code.

gromakovsky commented 5 years ago

Done in #195.