Porting Untyped Modules to Typed Racket

Sam Tobin-Hochstadt <samth@ccs.neu.edu>

To adapt a library to Typed Racket, the following steps are required:

For example, here’s a module for adapting the racket/bool library:

#lang typed/racket
(require/typed racket/bool
               [true Boolean]
               [false Boolean]
               [symbol=? (Symbol Symbol -> Boolean)]
               [boolean=? (Boolean Boolean -> Boolean)]
               [false? (Any -> Boolean)])
(provide true false symbol=? boolean=? false?)

More substantial examples are available in the typed collection. In particular, see the various files in typed/net, such as typed/net/url.ss.