Jannis
12/19/2019, 7:17 PMap
(it's actually solution to many many more problems 🙈 ) with that we would instantly return from traverse
and execute/bind the IO
as we goJannis
12/19/2019, 7:28 PMfun Kind<F, A>.lazyAp(ff: () -> Kind<F, A -> B>): Kind<F, B>
and we are set. That solves this particular problem, it solves the problem in alternative which causes the default implementation for some
and many
to overflow and changes the semantics of traverse
to actually short-circuit and not run the fold all the way and short on an operation by operation level. This is the second time this week someone fell over this issue, so I think we should really consider adding it.
@pakoito @raulraja
I know I proposed this a while ago, and the problems were that this only extends to ap
and it's yet another method a datatype has to implement. Also this can be done via compiler plugin. But all these aside, a solution via a compiler plugin is at least a few weeks if not months out, so I think adding this and changing traverse
+ some
+ many
now and later replacing it with a compiler plugin solution is a better idea.Jannis
12/19/2019, 8:19 PMSequence.plus
. This sucksraulraja
12/19/2019, 8:26 PMJannis
12/19/2019, 8:29 PMfun Sequence<A>.plus(a: A): Sequence<A>
is not stacksafe once you force a long sequence. Don't know how to solve thatraulraja
12/19/2019, 8:33 PM+
for Sequence locally or not use plus but a stack safe version of it based on Eval or AndThen?raulraja
12/19/2019, 8:33 PMraulraja
12/19/2019, 8:33 PMJannis
12/19/2019, 8:34 PMraulraja
12/19/2019, 8:34 PMunsafeToSequence()
Jannis
12/19/2019, 8:34 PMJannis
12/19/2019, 8:34 PMJannis
12/19/2019, 8:35 PMraulraja
12/19/2019, 8:35 PMJannis
12/19/2019, 8:39 PMraulraja
12/19/2019, 9:29 PM