Skyb0rg007 / recursion-schemes-ix

Recursion schemes over indexed Functors
https://skyb0rg007.github.io/recursion-schemes-ix/
BSD 3-Clause "New" or "Revised" License
4 stars 1 forks source link

Add TH for deriving indexed functor for mutually recursive datatype #2

Open dylan-thinnes opened 3 years ago

dylan-thinnes commented 3 years ago

Implemented a TH snippet that takes an entry point for a mutually recursive datatype and produces an index and indexed functor.

Things to discuss:

  1. Want to add the dependency, and rewrite the README to reflect that, or
  2. Remove the dependency, paste in the generated boilerplate from recursion-schemes.

Either way I think we have something worth merging!

dylan-thinnes commented 3 years ago

1 <- issue that started PR

dylan-thinnes commented 3 years ago

So I've implemented a deriveIFunctorITraversable function, and reworked deriveMutualGADT to handle type variables in data types, but it's getting late in the UK so cleaning up of variable names will have to wait till tomorrow afternoon.

Still interested to hear your thoughts! If you want anything explained, give me a shout.

dylan-thinnes commented 3 years ago

The IFunctor instance logic needed to account for a couple of extra rules, esp. w/ regards to tuples and double-contravariance, as documented for the DeriveFunctor language extension.

Still haven't fixed this for ITraversable, forthcoming.