[racket] define-predicate problem with HashTable type constructor

From: Asumu Takikawa (asumu at ccs.neu.edu)
Date: Sat Oct 19 14:25:01 EDT 2013

On 2013-10-19 10:26:22 -0700, Erik Pearson wrote:
>    Type Checker: Type X could not be converted to a contract. in: X

This is not a bug. To construct a predicate for a type, the type has to
have a contract that can be immediately checked (like `number?`).

That's not possible in general for a hashtable because it may be
mutable, and its contents must be checked on any read or write.

You may want to consider using a cast instead.

Cheers,
Asumu

Posted on the users mailing list.