Created
March 17, 2013 02:47
-
-
Save danking/5179334 to your computer and use it in GitHub Desktop.
Weirdness with #:when in for macros of typed racket
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
| #lang typed/racket | |
| (for*/list: : [Listof [List Integer]] | |
| ((x : Integer (in-range 0 10))) | |
| (list x)) | |
| (for*/list: : [Listof [List Integer Integer]] | |
| ((x : Integer (in-range 0 10))) | |
| (list x x)) | |
| (for/list: : [Listof [List Integer Integer]] | |
| ((x : Integer (in-range 0 10)) | |
| (y : Integer (in-range 0 10))) | |
| (list x y)) | |
| ;; doesn't type check | |
| (for/list: : [Listof [List Integer Integer]] | |
| ((x : Integer (in-range 0 10)) | |
| #:when #t | |
| (y : Integer (in-range 0 10))) | |
| (list x y)) | |
| ;; doesn't type check | |
| (for*/list: : [Listof [List Integer Integer]] | |
| ((x : Integer (in-range 0 10)) | |
| (y : Integer (in-range 0 10))) | |
| (list x y)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment