-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Specify compiled patterns using annotations
- Loading branch information
Showing
18 changed files
with
199 additions
and
942 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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,35 @@ | ||
:js | ||
:cp | ||
|
||
class Pair[A, B](val first: A, val second: B) | ||
|
||
pattern Bit = 0 | 1 | ||
|
||
:expect true | ||
0 is Bit | ||
0 is @compile Bit | ||
//│ = true | ||
|
||
:expect true | ||
1 is Bit | ||
1 is @compile Bit | ||
//│ = true | ||
|
||
:expect false | ||
42 is Bit | ||
42 is @compile Bit | ||
//│ = false | ||
|
||
pattern BitSeq = null | Pair(Bit, BitSeq) | ||
|
||
null is BitSeq | ||
:expect true | ||
null is @compile BitSeq | ||
//│ = true | ||
|
||
Pair(0, null) is BitSeq | ||
:expect true | ||
Pair(0, null) is @compile BitSeq | ||
//│ = true | ||
|
||
Pair(1, Pair(0, null)) is BitSeq | ||
:expect true | ||
Pair(1, Pair(0, null)) is @compile BitSeq | ||
//│ = true | ||
|
||
Pair(2, null) is BitSeq | ||
:expect false | ||
Pair(2, null) is @compile BitSeq | ||
//│ = false |
Oops, something went wrong.