Skip to content

Instantly share code, notes, and snippets.

@danking
Created March 17, 2013 02:47
Show Gist options
  • Select an option

  • Save danking/5179334 to your computer and use it in GitHub Desktop.

Select an option

Save danking/5179334 to your computer and use it in GitHub Desktop.
Weirdness with #:when in for macros of typed racket
#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