From a6f6a5cf4352abb48e6c37c35df9d3a6f5758b9c Mon Sep 17 00:00:00 2001 From: Asumu Takikawa Date: Sat, 4 Jan 2014 17:29:20 -0500 Subject: [PATCH] Document alternative type annotation form original commit: 79ffd87a67f056b00f2531f0efa5e4ea1e7fa224 --- .../scribblings/reference/special-forms.scrbl | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/pkgs/typed-racket-pkgs/typed-racket-doc/typed-racket/scribblings/reference/special-forms.scrbl b/pkgs/typed-racket-pkgs/typed-racket-doc/typed-racket/scribblings/reference/special-forms.scrbl index bd1e6371..a1e9b2ca 100644 --- a/pkgs/typed-racket-pkgs/typed-racket-doc/typed-racket/scribblings/reference/special-forms.scrbl +++ b/pkgs/typed-racket-pkgs/typed-racket-doc/typed-racket/scribblings/reference/special-forms.scrbl @@ -318,11 +318,20 @@ Equivalent to @racket[(define name (make-predicate t))]. @section{Type Annotation and Instantiation} -@defform[(: v t)]{This declares that @racket[v] has type @racket[t]. +@defform*[((: v t) + (: v : t))]{ +This declares that @racket[v] has type @racket[t]. The definition of @racket[v] must appear after this declaration. This can be used anywhere a definition form may be used. @ex[(: var1 Integer) - (: var2 String)]} + (: var2 String)] + +The second form allows type annotations to elide one level of parentheses +for function types. + +@ex[(: var3 : -> Integer) + (: var4 : String -> Integer)] +} @defform[(provide: [v t] ...)]{This declares that the @racket[v]s have the types @racket[t], and also provides all of the @racket[v]s.}