[racket] Typed Racket: Infinite Subtypes?
I'll try to respond more comprehensively about the more general
question, but for this:
On Fri, Jun 10, 2011 at 2:12 PM, Richard Lawrence
<richard.lawrence at berkeley.edu> wrote:
>
> And if it isn't possible, the cleanest workaround I can think of is to
> tag all Variable values, like:
>
> (define-type Variable (Pair 'var Symbol))
> (define-predicate variable? Variable)
Just use a struct:
(struct: variable ([s : Symbol]))
Now you have `variable' and `variable?' and `variable-s', and there's
no confusion with pairs. That's how I'd write this code.
--
sam th
samth at ccs.neu.edu