-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support 'as' pattern in Elm syntax pattern
+ Add a scenario using the 'as' keyword in patterns in case-of block to automated tests. + Expand the compilation of Elm syntax patterns to support this pattern type and add the resulting declaration. + Expand the composition of display strings for Elm values to add parens where needed, like nested choice type tags.
- Loading branch information
Showing
5 changed files
with
76 additions
and
15 deletions.
There are no files selected for viewing
This file contains 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 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 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
1 change: 1 addition & 0 deletions
1
.../test-elm-time/elm-interactive-scenarios/deconstruct-pattern/steps/150/expected-value.txt
This file contains 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 @@ | ||
[[[]],[[],[Just Nothing]],[[Just (Just 4)],[Just (Just 5)]]] |
18 changes: 18 additions & 0 deletions
18
...ment/test-elm-time/elm-interactive-scenarios/deconstruct-pattern/steps/150/submission.txt
This file contains 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,18 @@ | ||
let | ||
deconsMaybeMaybe maybeMaybe = | ||
case maybeMaybe of | ||
Nothing -> | ||
[ [] ] | ||
|
||
(Just Nothing) as justNothing -> | ||
[ [], [ justNothing ] ] | ||
|
||
(Just (Just x)) as justJust -> | ||
[ [ justJust ] | ||
, [ Just (Just (x + 1)) ] | ||
] | ||
in | ||
[ deconsMaybeMaybe Nothing | ||
, deconsMaybeMaybe (Just Nothing) | ||
, deconsMaybeMaybe (Just (Just 4)) | ||
] |