hs-to-coq icon indicating copy to clipboard operation
hs-to-coq copied to clipboard

Deal with `Default` instance generation

Open antalsz opened this issue 6 years ago • 2 comments

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:

  1. Default Int – type of kind Type which may or may not have Default instances.
  2. Default (Maybe a) – type constructors which always have a Default instance.
  3. Default a => Default (Pair a) – type constructors which have a Default instance when their arguments do.

This also doesn't address higher-order type constructors…

antalsz avatar Oct 04 '18 04:10 antalsz

Can you make this ticket more concrete?

sweirich avatar Oct 04 '18 14:10 sweirich

@sweirich done, although I haven't looked into the details closely

antalsz avatar Oct 07 '18 06:10 antalsz