contract.scrbl (1391B)
1 #lang scribble/manual 2 @require[racket/require 3 "utils.rkt" 4 @for-label[phc-toolkit/contract 5 racket/function 6 racket/contract]] 7 @title{contract} 8 @author{@author+email["Suzanne Soy" "racket@suzanne.soy"]} 9 @defmodule[phc-toolkit/contract 10 #:use-sources 11 [(submod (lib "phc-toolkit/contract.rkt") typed)]] 12 13 @defproc[(regexp-match/c [rx (or/c string? regexp?)]) contract? 14 #:value (and/c (or/c string? bytes? path? input-port?) 15 (curry regexp-match? rx))]{ 16 17 Returns a contract which accepts only values matching the given regular 18 expression.} 19 20 @defproc[(id/c [id identifier?]) contract? 21 #:value (and/c identifier? (curry free-identifier=? id))]{ 22 Returns a contract which accepts only identifiers which are 23 @racket[free-identifier=?] to @racket[id].} 24 25 @defidform[define/contract?]{ 26 Like @racket[define/contract], but later versions of this library may allow 27 disabling the contracts via a parameter or syntax parameter. This form will be 28 useful for internal functions, to ease debugging during development, but with 29 the (future) possibility of disabling the contracts in the final version, to 30 avoid the performance cost of checking many contracts between internal 31 functions.} 32 33 @include-section{contract-untyped.scrbl}