Closed ivan-m closed 7 years ago
I agree this would be more principled, but I'm hesitant at this point. I'll think about this...
Sure; this is a "if you're going to be making breaking changes anyway ..." issue.
How about if nothing else changing the generic definitions, since they're not exported?
@ivan-m can you make a PR to show what you mean? cleaning up internals if they don't leak into the API sounds good to me; assuming they have no measurable performance regression
Nevermind, selName
takes a value and hence requires undefined
, so we'd be converting to Proxy
just to convert back to undefined
.
I'm going to close this until/unless selName
in GHC.Generics
uses Proxy
rather than undefined
.
I actually just triggered Prelude.undefined
because of this, by accidentally writing an instance like
instance DefaultOrdered Student where
headerOrder Student{..} = header [...]
In hindsight, I should have noticed the unused variable, but I was just writing a hackish script. I believe the haddocks could be more clear about this. Currently, they only refer to how to call this function, but not to the caveats that may arise when implementing it.
Currently, the
DefaultOrdered
class' methodheaderOrder
takes an argument whose value isn't used, just the type. Shouldn't aProxy
be used instead?(This will, however, be a breaking change.)