On this page:
3.1 Porting Untyped Modules to Typed Racket
6.3

3 Libraries Provided With Typed Racket

The typed/racket language corresponds to the racket language—that is, any identifier provided by racket, such as modulo is available by default in typed/racket.

#lang typed/racket
(modulo 12 2)

The typed/racket/base language corresponds to the racket/base language.

Some libraries have counterparts in the typed collection, which provide the same exports as the untyped versions. Such libraries include srfi/14, net/url, and many others.

#lang typed/racket
(require typed/srfi/14)
(char-set= (string->char-set "hello")
           (string->char-set "olleh"))

Other libraries can be used with Typed Racket via require/typed.

#lang typed/racket
(require/typed version/check
               [check-version (-> (U Symbol (Listof Any)))])
(check-version)

The following libraries are included with Typed Racket in the typed collection:

 (require typed/file/gif) package: typed-racket-more
 (require typed/file/md5) package: typed-racket-lib
 (require typed/file/tar) package: typed-racket-lib
 (require typed/framework) package: typed-racket-more
 (require typed/json) package: typed-racket-more
 (require typed/mred/mred) package: typed-racket-more
 (require typed/net/base64) package: typed-racket-more
 (require typed/net/cgi) package: typed-racket-more
 (require typed/net/cookie) package: typed-racket-more
 (require typed/net/dns) package: typed-racket-more
 (require typed/net/ftp) package: typed-racket-more
 (require typed/net/gifwrite) package: typed-racket-more
 (require typed/net/git-checkout)
  package: typed-racket-more
 (require typed/net/head) package: typed-racket-more
 (require typed/net/http-client)
  package: typed-racket-more
 (require typed/net/imap) package: typed-racket-more
 (require typed/net/mime) package: typed-racket-more
 (require typed/net/nntp) package: typed-racket-more
 (require typed/net/pop3) package: typed-racket-more
 (require typed/net/qp) package: typed-racket-more
 (require typed/net/sendmail) package: typed-racket-more
 (require typed/net/sendurl) package: typed-racket-more
 (require typed/net/smtp) package: typed-racket-more
 (require typed/net/uri-codec)
  package: typed-racket-more
 (require typed/net/url-connect)
  package: typed-racket-more
 (require typed/net/url-structs)
  package: typed-racket-more
 (require typed/net/url) package: typed-racket-more
 (require typed/openssl/md5) package: typed-racket-more
 (require typed/openssl/sha1) package: typed-racket-more
 (require typed/openssl) package: typed-racket-more
 (require typed/pict) package: typed-racket-more
 (require typed/racket/async-channel)
  package: typed-racket-more

Added in version 1.1 of package typed-racket-lib.

 (require typed/racket/date) package: typed-racket-lib
 (require typed/racket/draw) package: typed-racket-more
 (require typed/racket/gui) package: typed-racket-more
 (require typed/racket/sandbox)
  package: typed-racket-more
 (require typed/racket/snip) package: typed-racket-more
 (require typed/racket/system) package: typed-racket-lib
 (require typed/rackunit/docs-complete)
  package: typed-racket-more
 (require typed/rackunit/gui) package: typed-racket-more
 (require typed/rackunit/text-ui)
  package: typed-racket-more
 (require typed/rackunit) package: typed-racket-more
 (require typed/srfi/14) package: typed-racket-more
 (require typed/srfi/19) package: typed-racket-more
 (require typed/syntax/stx) package: typed-racket-more

In some cases, these typed adapters may not contain all of exports of the original module, or their types may be more limited.

Other libraries included in the main distribution that are either written in Typed Racket or have adapter modules that are typed:

 (require math) package: math-lib
 (require plot/typed) package: plot-gui-lib

3.1 Porting Untyped Modules to Typed Racket

To adapt a Racket library not included with Typed Racket, the following steps are required:

For example, the following module adapts the untyped 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.