Conversation
| * | ||
| * @group algtrans | ||
| */ | ||
| @tailrec |
There was a problem hiding this comment.
I would like this to be a function, but the problem is that we need this to be tail recursive.
We could actually rewrite this as a coalgebra, like:
final def repeatedlyƒ[A](f: A => Option[A]): Coalgebra[A \/ ?, A] = f(expr) \/> expr
final def repeatedly[A](f: A => Option[A]): A => A =
_.ana[Nu](repeatedlyƒ(f)).unsafePerformSyncWe have some stack-safety tests of Partial that make me think this works, although no performance promises.
But then maybe we can rewrite stuff to use repeatedlyƒ instead of repeatedly, and track partiality through more of the code.
@edmundnoble – thoughts?
| AlgebraM[M, CoEnv[A, F, ?], B] = | ||
| ginterpretM[Id, M, F, A, B](f, φ) | ||
|
|
||
| def ginterpret[W[_], F[_], A, B](f: A => Id[B], φ: GAlgebra[W, F, B]): GAlgebra[W, CoEnv[A, F, ?], B] = |
|
So, Matryoshka has a new definition of |
|
👍 but Monday after spark summit |
|
@rabbitonweb Ping. |
repeatedlyreturns one more time a function value (instead of being a method).also added
ginterpret