diff --git a/typed-racket-doc/typed-racket/scribblings/guide/more.scrbl b/typed-racket-doc/typed-racket/scribblings/guide/more.scrbl index b6e0d3fd..54028b75 100644 --- a/typed-racket-doc/typed-racket/scribblings/guide/more.scrbl +++ b/typed-racket-doc/typed-racket/scribblings/guide/more.scrbl @@ -3,8 +3,7 @@ @begin[(require "../utils.rkt" scribble/core scribble/eval (for-label (only-meta-in 0 typed/racket) - (prefix-in base: racket) - (only-in mzlib/etc let+)))] + (prefix-in base: racket)))] @title[#:tag "more"]{Specifying Types} @@ -108,11 +107,14 @@ applied to a single variable using a reader extension: This is equivalent to the earlier use of @racket[let]. This is mostly useful for binding forms which do not have counterparts -provided by Typed Racket, such as @racket[let+]: +provided by Typed Racket, such as @racket[match]: @racketblock[ -(let+ ([val #,(annvar x Number) (+ 6 1)]) - (* x x))] +(: assert-symbols! ((Listof Any) -> (Listof Symbol))) +(define (assert-symbols! lst) + (match lst + [(list (? symbol? #,(annvar s (Listof Symbol))) ...) s] + [_ (error "expected only symbols, given" lst)]))] @subsection{Annotating Expressions} diff --git a/typed-racket-doc/typed-racket/scribblings/guide/types.scrbl b/typed-racket-doc/typed-racket/scribblings/guide/types.scrbl index 1916a50c..f1c9c9f6 100644 --- a/typed-racket-doc/typed-racket/scribblings/guide/types.scrbl +++ b/typed-racket-doc/typed-racket/scribblings/guide/types.scrbl @@ -123,6 +123,10 @@ unions are flattened. themselves. This allows a type to describe an infinite family of data. For example, this is the type of binary trees of numbers. +@margin-note[]{ +Recursive types can also be created anonymously without the use of +@racket[define-type] using the @racket[Rec] type constructor.} + @racketblock[ (define-type BinaryTree (U Number (Pair BinaryTree BinaryTree)))]