hs-to-coq
hs-to-coq copied to clipboard
Deal with `Default` instance generation
As we saw in #100 (preserving record names), our story for tracking Default
instances isn't great and needs some manual skipping.
As I understand it, #100 introduces too many Default
instances, and so we need to start keeping better track of which types have such instances. That way, we can check that some constructor can be fully applied to default arguments.
I haven't looked at the Default
code, but we'll need to be careful to differentiate between three cases:
-
Default Int
– type of kindType
which may or may not haveDefault
instances. -
Default (Maybe a)
– type constructors which always have aDefault
instance. -
Default a => Default (Pair a)
– type constructors which have aDefault
instance when their arguments do.
This also doesn't address higher-order type constructors…
Can you make this ticket more concrete?
@sweirich done, although I haven't looked into the details closely