To print a warning during compilation, we added a type class called
is located in the
Prim module and is defined as:
It is indexed by a
Symbol - you can read about symbols here.
If this type class is used as a constraint in a type, for example:
When this function is used and the compiler starts solving for the constraints,
it will trivially solve the
Warn instance and print out the message.
Another use case is a deprecation message with upgrade instructions:
I’ve written about this on the documentation repo.