Open dylan-thinnes opened 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.
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.
Implemented a TH snippet that takes an entry point for a mutually recursive datatype and produces an index and indexed functor.
Things to discuss:
recursion-schemes
to generate the instances for a single-use catamorphism. It does eliminate a fair bit of boilerplate, but sort of counteracts the "minimal dependencies" claim in the README. It also creates orphan instances, which I hide in an Internal. We need to decide whether we:l
type variable that needs to be carried around. Unfortunately I suspect that making it general to more complex type variables would require us to replace singlethongs (which only produces instances for simple enum types) with the much bigger singletons. I may want to just make a separate library for this.Either way I think we have something worth merging!