obsidiansystems / dependent-sum

Dependent sums and supporting typeclasses for comparing and displaying them
54 stars 39 forks source link

Modernize TH #53

Closed 3noch closed 2 years ago

3noch commented 4 years ago

From @cgibbard:

This PR is to make deriveGEq, deriveGCompare, and deriveGShow work on many more types.

There were a bunch of various handwritten instances in other projects which I was able to replace with TH.

One thing in particular that I recall fixing were cases where a dictionary argument made Show available for an argument also, cases where there were multiple parameter GADTs and you ended up needing Eq on one of the earlier parameters like

data Foo a b where
  A :: a -> Foo a a

You end up needing an Eq instance on a. I think it was messing this up in some fashion or something close to this.

cgibbard commented 4 years ago

There are a couple of commented-out instances for DeriveGCompare and DeriveGEq, we need to reinstate/rewrite them.

3noch commented 4 years ago

The build is failing because th-extras 0.5 doesn't exist. We'll have to release that first.

3noch commented 4 years ago

@cgibbard Is this all we need? https://github.com/mokus0/th-extras/pull/6

3noch commented 4 years ago

The merge of master into this branch is incorrect and must be redone.