[racket] TR: typechecking for*/and

From: Matthew Butterick (mb at mbtype.com)
Date: Fri Feb 6 21:04:56 EST 2015

The first three loops typecheck as expected, but the fourth, using for*/and with two bindings, does not. What is missing?

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

#lang typed/racket

(for*/sum : Integer
  ([i : Integer (in-range 10)])
  1)

;; 10

(for*/and : Boolean
  ([i : Integer (in-range 10)])
  #t)

;; #t

(for*/sum : Integer
  ([i : Integer (in-range 10)]
   [j : Integer (in-range 10)])
  1)

;; 100

(for*/and : Boolean
  ([i : Integer (in-range 10)]
   [j : Integer (in-range 10)])
  #t)

;; Error in macro expansion -- insufficient type information to typecheck


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;



Posted on the users mailing list.