You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Essentially it's too hard to implement builders for computations that respect tailcalls correctly. However, the analysis can easily be done in the compiler treatment of computation expressions. We should support this in the language.
The text was updated successfully, but these errors were encountered:
You’re writing “it’s too hard”. I know we attempted an implementation by using ReturnFrom in TaskSeq with trampolining, however, that only worked where the first of the two returns was returning unit. Also, semantically, return(!) has no place in sequence builders with yield.
I’m wondering if “too hard” here means “there’s a way to code it”, or “it’s impossible without explicit language support”. Specifically directly through existing YieldFrom.
I mean, I don’t see a way to detect in code that yield! is recursive. The way this is solved in AsyncSeq is by using a continuation passing style throughout, which comes with detrimental performance as it is becomes necessary to build and allocate a new sequence for each bind (ie, let! there wraps the whole sequence in a new sequence with one additional member, requiring two extra interface allocations).
If there is a way currently, I’d be interested to know how :).
Placeholder to track a suggestion from here fsprojects/FSharp.Control.TaskSeq#62 (comment)
Essentially it's too hard to implement builders for computations that respect tailcalls correctly. However, the analysis can easily be done in the compiler treatment of computation expressions. We should support this in the language.
The text was updated successfully, but these errors were encountered: