Closed gergoerdi closed 4 years ago
I have now added documentation as well. I am eagerly awaiting your response, since there is a project where I'd like to start using this feature.
OK I have resolved most of your feedback. The only remaining items are:
DistributiveT
bcollect
be a function or a method?For DistributiveT
, I hope it should be mostly a matter of copying the Barbies.Internal.DistributiveB
module, add the extra type parameter to type signatures and use GDistributive 1
instead GDistributive 0
in instances (this is the position where the functor argument occurs in the type)
I think I'm all done.
I have to say though, most of the generic instances are peak "I have no idea what I'm doing" territory. If GHC didn't have typed holes, I would have never been able to write them :)
@gergoerdi I'm adding some minor clean-ups and documentation updates. I'm presenting the class laws in terms of brecompose / bdecompose
and removed bshape
since I felt it was only useful for the sake of presenting the laws. If it's something you'd use, I'm happy to add it back. Similarly, I ended up replacing bcollect
(which was my suggestion) by bcotraverse
that we have the dual of btraverse
; bcollect
didn't seem too useful with that signature. Let me know what you think!
Great, thanks a lot!
bshape
is fully redundant now, because it is trivially recoverable as bdecompose id
, so I agree there's no need to keep it.
All tests pass, and hopefully they test the actual relevant laws :)
@gergoerdi thanks for all your work on this!
Thanks, this is great!
As discussed in #26.
Note that I am deeply in this territory here, so some generic
GShape
instances still need to be written: