-
-
Notifications
You must be signed in to change notification settings - Fork 104
Unicode lambda #1374
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
Merged
Unicode lambda #1374
Changes from 2 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
b945861
Add unicode lambda forms
NoahStoryM 7fa7c30
test unicode lambda forms.
NoahStoryM 3684fa1
Remove `case-λ:`, `pcase-λ:`, `pλ:`, `λ:`, `popt-λ:`, `opt-λ:`.
NoahStoryM d66550e
Merge remote-tracking branch 'upstream/master' into unicode-lambda
NoahStoryM 2182539
Testing type annotations for `case-λ`
NoahStoryM 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
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
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
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 |
|---|---|---|
| @@ -1,8 +1,27 @@ | ||
| #lang typed/racket/base | ||
|
|
||
| (: foo (→* ((∪ Symbol String)) (Integer) (Pair Boolean Integer))) | ||
| (define foo | ||
| (λ (s [i 0]) | ||
| (cons (symbol? s) i))) | ||
| (foo 'abc) | ||
| (foo "abc") | ||
| (: foo0 (∀ () (→* ((∪ Symbol String)) (Integer) (Pair Boolean Integer)))) | ||
| (: foo1 (∀ () (→* ((∪ Symbol String) Integer) () (Pair Boolean Integer)))) | ||
| (: foo2 (∀ () (→* ((∪ Symbol String) Integer) () (Pair Boolean Integer)))) | ||
| (: foo3 (∀ () (→* ((∪ Symbol String)) (Integer) (Pair Boolean Integer)))) | ||
| (: foo4 (∀ () (→* ((∪ Symbol String)) (Integer) (Pair Boolean Integer)))) | ||
| (define foo0 (λ #:∀ () ([s : (∪ Symbol String)] [i : Integer 0]) : (Pair Boolean Integer) (cons (symbol? s) i))) | ||
| (define foo1 (λ: ([s : (∪ Symbol String)] [i : Integer]) : (Pair Boolean Integer) (cons (symbol? s) i))) | ||
| (define foo2 (pλ: () ([s : (∪ Symbol String)] [i : Integer]) : (Pair Boolean Integer) (cons (symbol? s) i))) | ||
| (define foo3 (opt-λ: ([s : (∪ Symbol String)] [i : Integer 0]) : (Pair Boolean Integer) (cons (symbol? s) i))) | ||
| (define foo4 (popt-λ: () ([s : (∪ Symbol String)] [i : Integer 0]) : (Pair Boolean Integer) (cons (symbol? s) i))) | ||
| (foo0 'abc 0) (foo0 "abc" 0) | ||
| (foo1 'abc 0) (foo1 "abc" 0) | ||
| (foo2 'abc 0) (foo2 "abc" 0) | ||
| (foo3 'abc 0) (foo3 "abc" 0) | ||
| (foo4 'abc 0) (foo4 "abc" 0) | ||
|
|
||
| (: bar0 (∀ () (case→ (→ True) (→ Any False)))) | ||
| (: bar1 (∀ () (case→ (→ True) (→ Any False)))) | ||
| (: bar2 (∀ () (case→ (→ True) (→ Any False)))) | ||
| (define bar0 (case-λ #:∀ () [() #t] [(_) #f])) | ||
| (define bar1 (case-λ: #:∀ () [() #t] [(_) #f])) | ||
| (define bar2 (pcase-λ: () [() #t] [(_) #f])) | ||
| (bar0) (bar0 bar0) | ||
| (bar1) (bar1 bar1) | ||
| (bar2) (bar2 bar2) |
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.
I don't think we should add/change anything to legacy or compatibility libraries.
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.
If this file is not modified, an error will be reported (I forgot to record the specific error message).
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.
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.
Ah, I read the wrong file in the reply, sorry!