Fix the labels and add explicit "(untyped)" to conflicts.

This commit is contained in:
Sergiu Ivanov 2022-04-10 19:55:28 +02:00
parent 81496a2ee7
commit 6102a2b8f3

View file

@ -217,15 +217,24 @@ same arity.
@section[#:tag "fuctions/untyped"]{Untyped definitions}
@defmodule[(submod dds/functions untyped)]
@defmodule[(submod dds/functions typed untyped)]
@(require (for-label (only-in racket/contract/base listof any/c)))
@(require (for-label (only-in racket/contract/base listof any/c)
(for-label (only-in (submod "../functions.rkt" typed untyped)
tabulate/boolean tabulate*/boolean
tabulate/01 tabulate*/01))))
This submodule contains some functions which cannot be typed or some functions
for which Typed Racket cannot produce contracts, i.e. polymorphic functions of
variable arity. The definitions in this submodule specifically target untyped
user code.
Since the names of some of the definitions in this submodule are the same in
the main module, and since they are imported in the same namespace for
rendering this document, some references to untyped definitions may wrongfully
point to typed definitions. As a tentative fix, all such references are
accompanied by the explicit mention "untyped".
@(define functions-evaluator/untyped
(parameterize ([sandbox-output 'string]
[sandbox-error-output 'string]
@ -248,8 +257,8 @@ arguments and the value of the functions for these inputs.
[doms (listof list?)])
(listof list?)]{
Like @racket[tabulate], but @racket[funcs] is a list of functions taking the
same arguments over the same domains.
Like @racket[tabulate] (untyped), but @racket[funcs] is a list of functions
taking the same arguments over the same domains.
@examples[#:eval functions-evaluator/untyped
(tabulate* (list (λ (x y) (and x y))
@ -259,9 +268,9 @@ same arguments over the same domains.
@defproc[(tabulate/boolean [func procedure?]) (listof (listof boolean?))]{
Like @racket[tabulate], but assumes the domains of all variables of the
function are Boolean. @racket[func] must have a fixed arity. It is an error
to supply a function of variable arity.
Like @racket[tabulate] (untyped), but assumes the domains of all variables of
the function are Boolean. @racket[func] must have a fixed arity. It is an
error to supply a function of variable arity.
@examples[#:eval functions-evaluator/untyped
(tabulate/boolean (lambda (x y) (and x y)))
@ -280,8 +289,8 @@ same arity.
@defproc[(tabulate/01 [func procedure?]) (listof (listof (or/c 0 1)))]{
Like @racket[tabulate], but assumes the domains of all variables of the
function are @tt{{0,1}}. @racket[func] must have a fixed arity. It is an
Like @racket[tabulate] (untyped), but assumes the domains of all variables of
the function are @tt{{0,1}}. @racket[func] must have a fixed arity. It is an
error to supply a function of variable arity.
@examples[#:eval functions-evaluator/untyped
@ -294,8 +303,7 @@ The same remarks apply as for @racket[tabulate/boolean] (untyped).
@defproc[(tabulate*/01 [funcs (listof procedure?)]) (listof (listof (or/c 0 1)))]{
Like @racket[tabulate/01] (untyped), but takes a list of functions of the
same arity.
Like @racket[tabulate/01], but takes a list of functions of the same arity.
@examples[#:eval functions-evaluator/untyped
(tabulate*/01 `(,(λ (x y) (min x y)) ,(λ (x y) (max x y))))