Closed klaeufer closed 7 years ago
Good catch. I’m working on writing some tut docs to replace the bulk of the README, and I’ll make sure to address this there.
One other thing I recommend is to avoid using specific fixed-point types as much as possible.
// Prefer
def foo[T, F[_]: Functor](fa: F[T])(implicit T: Recursive.Aux[T, F]): T
// over
def foo[F[_]](fa: F[Fix[F]]): Fix[F]
as it makes the algebra much more general. (This is something else the new docs will go into.) And there are some upcoming changes to scalac that will reduce the noise involved.
@sellout I highly appreciate this generality, but the target audience for my examples are juniors, seniors, and master's students in CS and SE. If I can get them to understand functors, simple type-level recursion, and cata
/ana
, then that's a considerable success. 😄
Hi again, you might also want to mention in the README that instances of Delay[Equal, F]
and Delay[Show, F]
are required for the recursive types over F
to support Equal
and Show
.
(I hope this level of feedback is useful.)
Yes, thank you – this is extremely useful feedback. I find that since I wrote most of this code, I gloss over so much that is necessary in understanding it (and which I struggled to understand when I was first dealing with it). So I am very happy that you’ve opened these issues.
To use
Fix
etc., it is insufficient to import onlyAn explicit import of
matryoshka.data.Fix
etc. is required. It would be helpful if the README said so more prominently; right now, this is buried in theeval
example.