Conversation
This adds `ghyloM`, `dyna`, `codyna`, `codynaM` refolds. As well as a `ganaM` unfold. `FunctorT.translate` has been removed, as it is identical to `FunctorT.transAna` (and identical to `.transCata`, since the traversal order is irrelevant) and attempting to add `TraverseT.translateM` made it clear that sometimes you do care about whether its bottom-up or top-down (because the constraints on `F` and `G` differ), so now always explicitly use `transAna` or `transCata`. Fixed the type parameter order for `IdOps.ghylo`. Added a `Nat` type to `matryoshka.fixedpoint`. Added type aliases for transforms, and a conversion from Transform to Algebra. Added optics for algebras and folds. Made `freeEqual` available outside of tests.
|
sigh once again scaladoc breaks the build. |
Current coverage is 76.55%
@@ master #27 diff @@
==========================================
Files 25 25
Lines 416 465 +49
Methods 406 459 +53
Messages 0 0
Branches 8 5 -3
==========================================
+ Hits 312 356 +44
- Misses 104 109 +5
Partials 0 0
|
This triggered some other changes along the way, of course. - added a dependency on scalaz-specs2 and got rid of our local equal matcher - fixed the `height` algebra to return something other than 0
| equal(3) | ||
| } | ||
|
|
||
| // TODO: Should work with any Int, but stack overflows on big negatives. |
There was a problem hiding this comment.
In the implementation of unsafePerformSync, have you tried making it @tailrec by explicitly match-ing on the disjunction rather than fold-ing? I'm not sure if the Ops class gets in the way of scalac's "tco", but might work.
There was a problem hiding this comment.
I think you’re right that it should be @tailrec, but this actually overflows on the non-tailrecable mc91 (but feel free to tell me how I could make it tailrec).
There was a problem hiding this comment.
Yeah, not sure how to make mc91 tailrec, maybe Trampoline to avoid overflow? (No idea if that is possible with Partial either!)
|
👍 LGTM. A thought for the fixedpoint instances might be to make them value classes instead of aliases so that you can hang typeclass instances and operations off of them. |
|
|
||
| import scala.{Any, StringContext} | ||
| import scala.Predef.Set | ||
| import scala.Predef.{Set} |
|
Yeah, there’s actually a PR (#13) that converts them to classes. I have to rebase that and fix whatever issues were still there. |
- made `unsafePerformSync` tail recursive - added `min` and `max` operations to `Nat` - add `gapo` unfold - add a bunch of docs
|
Ok, addressed your comments, and some other minor stuff (as always), if you want to take a look. Otherwise I’ll merge when the build passes. |
|
Bravo on all the docs, merge away. |
This adds
ghyloM,dyna,codyna,codynaMrefolds. As well as aganaMunfold.FunctorT.translatehas been removed, as it is identical toFunctorT.transAna(and identical to.transCata, since the traversalorder is irrelevant) and attempting to add
TraverseT.translateMmade it clearthat sometimes you do care about whether its bottom-up or
top-down (because the constraints on
FandGdiffer), so now alwaysexplicitly use
transAnaortransCata.Fixed the type parameter order for
IdOps.ghylo.Added a
Nattype tomatryoshka.fixedpoint.Added type aliases for transforms, and a conversion from Transform to
Algebra.
Added optics for algebras and folds.
Made
freeEqualavailable outside of tests.