-
Notifications
You must be signed in to change notification settings - Fork 9
Direct fn calls: disable for cyclic calls #44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
supermario
merged 2 commits into
lamdera:lamdera-next
from
Janiczek:janiczek/make-it-stop-crashing
Mar 27, 2025
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
test/direct-fn-calls-mutual-recursion-partial-application/.gitignore
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
elm-stuff | ||
*.js |
29 changes: 29 additions & 0 deletions
29
test/direct-fn-calls-mutual-recursion-partial-application/elm.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"type": "application", | ||
"source-directories": [ | ||
"src" | ||
], | ||
"elm-version": "0.19.1", | ||
"dependencies": { | ||
"direct": { | ||
"elm/browser": "1.0.2", | ||
"elm/core": "1.0.5", | ||
"elm/html": "1.0.0", | ||
"elm/http": "2.0.0", | ||
"elm/json": "1.1.3", | ||
"elm/url": "1.0.0", | ||
"lamdera/codecs": "1.0.0", | ||
"lamdera/core": "1.0.0" | ||
}, | ||
"indirect": { | ||
"elm/bytes": "1.0.8", | ||
"elm/file": "1.0.5", | ||
"elm/time": "1.0.0", | ||
"elm/virtual-dom": "1.0.3" | ||
} | ||
}, | ||
"test-dependencies": { | ||
"direct": {}, | ||
"indirect": {} | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
test/direct-fn-calls-mutual-recursion-partial-application/src/Main.elm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
module Main exposing (main) | ||
|
||
import Html exposing (Html) | ||
|
||
|
||
main : Html msg | ||
main = | ||
Html.div [] | ||
[ Html.text (a1 3 4 5) | ||
, Html.text (a2 1 2 3 4 5) | ||
] | ||
|
||
|
||
a1 : Int -> Int -> Int -> String | ||
a1 = | ||
a2 1 2 | ||
|
||
|
||
a2 : Int -> Int -> Int -> Int -> Int -> String | ||
a2 x1 x2 x3 x4 x5 = | ||
if True then | ||
"done" | ||
|
||
else | ||
a1 3 4 5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
elm-stuff | ||
*.js |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"type": "application", | ||
"source-directories": [ | ||
"src" | ||
], | ||
"elm-version": "0.19.1", | ||
"dependencies": { | ||
"direct": { | ||
"elm/browser": "1.0.2", | ||
"elm/core": "1.0.5", | ||
"elm/html": "1.0.0", | ||
"elm/http": "2.0.0", | ||
"elm/json": "1.1.3", | ||
"elm/url": "1.0.0", | ||
"lamdera/codecs": "1.0.0", | ||
"lamdera/core": "1.0.0" | ||
}, | ||
"indirect": { | ||
"elm/bytes": "1.0.8", | ||
"elm/file": "1.0.5", | ||
"elm/time": "1.0.0", | ||
"elm/virtual-dom": "1.0.3" | ||
} | ||
}, | ||
"test-dependencies": { | ||
"direct": {}, | ||
"indirect": {} | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
module Main exposing (main) | ||
|
||
import Html exposing (Html) | ||
|
||
|
||
main : Html msg | ||
main = | ||
Html.div [] | ||
[ Html.text (a1 1) | ||
, Html.text (a2 1) | ||
, Html.text (b1 1 1) | ||
, Html.text (b2 1 1) | ||
] | ||
|
||
|
||
a1 : Int -> String | ||
a1 = | ||
a2 | ||
|
||
|
||
a2 : Int -> String | ||
a2 n = | ||
if n > 0 then | ||
a1 (n - 1) | ||
|
||
else | ||
"done" | ||
|
||
|
||
b1 : Int -> Int -> String | ||
b1 = | ||
b2 | ||
|
||
|
||
b2 : Int -> Int -> String | ||
b2 m n = | ||
if n > 0 then | ||
b1 (m - 1) (n - 1) | ||
|
||
else | ||
"done" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the test we're showing that the designated "beginning of the cycle" doesn't get called directly (there's no
$b1$
), but the other parts of the cycle do.