6.3.90.900
7.2 mischief/contract: Contracts
(require mischief/contract) | package: mischief-dev |
This module re-exports predicate/c from racket/contract.
syntax
(define-flat-rec-contract name-id contract-expr ...)
Defines a flat, recursive contract named name-id that accepts any of
the contract-expr variants.
Contract for dictionaries with keys contracted by key/c and values
contracted by val/c. Currently implemented as an impersonator
contract regardless of the values of key/c and val/c.
value
An alias for natural-number/c.
procedure
(type-predicate/c [ input/c #:strict? strict?] #:super super) → contract? input/c : contract? = any/c strict? : boolean? = #true super : (or/c predicate/c #false)
Produces a contract for predicate functions. With no arguments, equivalent to
predicate/c. The predicate’s argument is contracted by
input/c. If strict? is #true, its result must be a
boolean; otherwise it can be any value. If super is a predicate, then
the contracted predicate must only accept values that super also
accepts.