[#623] Make it difficult to misuse 'Show'
Description
Not updating changelog yet, want some feedback.
Problem: It's not good to use 'show' instead of 'build'. That may happen for different reasons, but one of the common ones is that 'show' seems misleadingly appealing.
Solution: Make it harder to use 'show' by limiting the types it can be applied to with an open type family 'PrettyShow'. Export unconstrained 'show' variant from "Debug" module. Update our code base to use 'pretty' preferentially. If pretty is not available, use 'Debug.show' for now.
Design notes: 'PrettyShow a' has kind 'Constraint' because we occasionally want to constrain the 'show' instance, e.g. 'PrettyShow (Fixed a) = HasResolution a'. For types that are always pretty, we can use empty list of constraints '()'
Related issue(s)
Resolves #623 (closed)
✅ Checklist for your Merge Request
Related changes (conditional)
- Tests (see short guidelines)
-
If I added new functionality, I added tests covering it. -
If I fixed a bug, I added a regression test to prevent the bug from silently reappearing again.
-
Technically all our code base is a one giant test for this
- Documentation
Stylistic guide (mandatory)
-
My commits comply with the following policy. -
My code complies with the style guide.