From 28c85dfd253a6e386da14758d0e95e9ecdd0a6a9 Mon Sep 17 00:00:00 2001 From: Vincent St-Amour Date: Tue, 7 Aug 2012 15:17:11 -0400 Subject: [PATCH] Add a separate "Exploring Types" section to the TR reference. --- .../scribblings/reference/experimental.scrbl | 9 --------- .../reference/exploring-types.scrbl | 19 +++++++++++++++++++ .../scribblings/ts-reference.scrbl | 1 + 3 files changed, 20 insertions(+), 9 deletions(-) create mode 100644 collects/typed-racket/scribblings/reference/exploring-types.scrbl diff --git a/collects/typed-racket/scribblings/reference/experimental.scrbl b/collects/typed-racket/scribblings/reference/experimental.scrbl index 66b04bab8f..8b80ddff09 100644 --- a/collects/typed-racket/scribblings/reference/experimental.scrbl +++ b/collects/typed-racket/scribblings/reference/experimental.scrbl @@ -10,15 +10,6 @@ These features are currently experimental and subject to change. @defform[(Class args ...)]{A type constructor for typing classes created using @racketmodname[racket/class].} @defform[(Instance c)]{A type constructor for typing objects created using @racketmodname[racket/class].} -@defform[(:type t)]{Prints the type @racket[_t].} - -@defform[(:print-type e)]{Prints the type of @racket[_e]. This prints the whole -type, which can sometimes be quite large.} - -@defform[(:query-result-type f t)]{Given a function @racket[f] and a desired -return type @racket[t], shows the arguments types @racket[f] should be given to -return a value of type @racket[t].} - @defform[(declare-refinement id)]{Declares @racket[id] to be usable in refinement types.} diff --git a/collects/typed-racket/scribblings/reference/exploring-types.scrbl b/collects/typed-racket/scribblings/reference/exploring-types.scrbl new file mode 100644 index 0000000000..e3b598f262 --- /dev/null +++ b/collects/typed-racket/scribblings/reference/exploring-types.scrbl @@ -0,0 +1,19 @@ +#lang scribble/manual + +@begin[(require "../utils.rkt") + (require (for-label (only-meta-in 0 [except-in typed/racket for])))] + +@title{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. + +@defform[(:type t)]{Prints the type @racket[_t].} + +@defform[(:print-type e)]{Prints the type of @racket[_e]. This prints the whole +type, which can sometimes be quite large.} + +@defform[(:query-result-type f t)]{Given a function @racket[f] and a desired +return type @racket[t], shows the arguments types @racket[f] should be given to +return a value of type @racket[t].} diff --git a/collects/typed-racket/scribblings/ts-reference.scrbl b/collects/typed-racket/scribblings/ts-reference.scrbl index 0f1f6ebc1b..1117fe867d 100644 --- a/collects/typed-racket/scribblings/ts-reference.scrbl +++ b/collects/typed-racket/scribblings/ts-reference.scrbl @@ -19,6 +19,7 @@ @include-section["reference/special-forms.scrbl"] @include-section["reference/libraries.scrbl"] @include-section["reference/utilities.scrbl"] +@include-section["reference/exploring-types.scrbl"] @include-section["reference/no-check.scrbl"] @include-section["reference/typed-regions.scrbl"] @include-section["reference/optimization.scrbl"]