On Sat, Nov 15, 2014 at 09:38:14AM +0800, Simon Hengel wrote:
* I think usage of MINIMAL pragmas could help a lot for your concerns about which of `display` or `displayBuilder` the user implements.
I'm not sure this will work. We would need to specify something like
{} | {displayBuilder}
as minimal complete definition (where {} denotes the empty set), but I'm not aware of a way to specify the empty set with MINIMAL.
Unless somebody knows a solution, I would probably open a GHC ticket and propose to extend the MINIMAL pragma to allow for empty sets.
Please ignore what I said above. It does not make sense in multiple regards. The minimal complete definition for Display is the empty set. We have the invariant that if you define `display` you also have to define `displayBuilder`. If we would have a way to specify all sets of methods that gives us a complete+consistent definition, then that would be: {{}, {displayBuilder}, {displayBuilder, display}} I don know a way how to do that with MINIMAL, nor do I know a straight forward way to extend MINIMAL to accommodate this use case. Cheers.