Open abelbraaksma opened 1 year ago
Yes, this should be rewritten with a loop
@abelbraaksma BTW I think I am going to prioritise an F# 8 addition to allow builders to specify ReturnFromTailcall
or YieldFromTailcall
methods.
@dsyme that would certainly simplify an addition like this, and would also allow task
to support tail calls. Awesome! We can do some early-adoption testing here through TaskSeq
.
We've removed the tail recursion because it was hard to consolidate it into
yield!
(it was instead done withreturn!
, which has no place intaskSeq
).However, today I helped someone with some code that he considered for
taskSeq
which had the following approach:As you can see, it uses
asyncSeq
, but also: it is recursive. The same approach withtaskSeq
would likely be more performant, however, if there are a lot of rows, this becomes problematic. This code can be rewritten with a loop, though.@dsyme, sharing this with you in case we want to revisit this at some point.