▼ |  | The Typed Racket Reference

1 | Type Reference
2 | Special Form Reference
3 | Libraries Provided With Typed Racket
4 | Utilities
5 | Exploring Types
6 | Typed Racket Syntax Without Type Checking
7 | Typed Regions
8 | Optimization in Typed Racket
9 | Legacy Forms
10 | Compatibility Languages
11 | Experimental Features

On this page:

: type
: print-type
: query-type/ args
: query-type/ result

Version: 5.3.1
top ← prev up next →

### 5`` Exploring Types

In addition to printing a summary of the types of REPL results, Typed Racket provides interactive utilities to explore and query types. The following bindings are only available at the Typed Racket REPL.

> > syntax

> > ( :type t)

Prints the type t.

> > syntax

> > ( :print-type e)

Prints the type of e. This prints the whole type, which can sometimes be quite large.

> > syntax

> > ( :query-type/args f t ...)

Given a function f and argument types t, shows the result type of f.

> > syntax

> > ( :query-type/result f t)

Given a function f and a desired return type t, shows the arguments types f should be given to return a value of type t.
top ← prev up next →