Version: 4.1.5.3

Porting Untyped Modules to Typed Scheme

Sam Tobin-Hochstadt <samth at ccs dot neu dot edu>

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

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

  #lang typed-scheme
  (require/typed scheme/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.