[racket] How do I make TR refinements work?

From: Neil Toronto (neil.toronto at gmail.com)
Date: Wed Feb 22 13:17:53 EST 2012

When I run this code:


#lang typed/racket

(: ten? (Integer -> Boolean))
(define (ten? x)
   (= x 10))

(declare-refinement ten?)
(define-type Ten (Refinement ten?))


I get this error:

Type Checker: cannot declare refinement for non-predicate Nothing in: 
(Refinement ten?)

But the test in "refinement-even.rkt" uses `even?' to define a 
refinement type, so I must be missing something. What is it?

Neil ⊥

Posted on the users mailing list.