Skip to content

Conversation

@dsyme
Copy link
Contributor

@dsyme dsyme commented Sep 1, 2017

This fixes #996 by adding a "let rec" case to the compilation of sequence expressions to state machines

As noted in #996, compiling to these sequence expressions to state machines ensures that even infinite "tailcalling" sequences can execute with finite resources

From the user perspective this means that the introduction of an innocuous "let rec" doesn't change observed resource usage

As noted in the tests, this doesn't cover the case where a let rec is used to define a non-function value such as a memoization table.

Copy link
Contributor

@KevinRansom KevinRansom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me.

@KevinRansom KevinRansom merged commit 8917d88 into dotnet:master Sep 1, 2017
dsyme pushed a commit to dsyme/fsharp that referenced this pull request Oct 13, 2017
@dsyme dsyme mentioned this pull request Oct 13, 2017
dsyme pushed a commit to dsyme/fsharp that referenced this pull request Oct 13, 2017
KevinRansom pushed a commit that referenced this pull request Oct 13, 2017
@brettfo brettfo mentioned this pull request Oct 13, 2017
brettfo added a commit that referenced this pull request Oct 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Recursive sequence expression containing recursive definition doesn't run in finite space

3 participants