racket/collects/unstable/scribblings/function.scrbl
2011-12-18 13:57:48 -07:00

50 lines
967 B
Racket

#lang scribble/manual
@(require scribble/eval "utils.rkt" (for-label racket unstable/function))
@(define the-eval (make-base-eval))
@(the-eval '(require unstable/function))
@title{Functions}
@defmodule[unstable/function]
@unstable[@author+email["Carl Eastlund" "cce@racket-lang.org"]]
This module provides tools for higher-order programming and creating functions.
@section{Higher Order Predicates}
@defproc[((conjoin [f (-> A ... boolean?)] ...) [x A] ...) boolean?]{
Combines calls to each function with @racket[and]. Equivalent to
@racket[(and (f x ...) ...)]
@defexamples[
#:eval the-eval
(define f (conjoin exact? integer?))
(f 1)
(f 1.0)
(f 1/2)
(f 0.5)
]
}
@defproc[((disjoin [f (-> A ... boolean?)] ...) [x A] ...) boolean?]{
Combines calls to each function with @racket[or]. Equivalent to
@racket[(or (f x ...) ...)]
@defexamples[
#:eval the-eval
(define f (disjoin exact? integer?))
(f 1)
(f 1.0)
(f 1/2)
(f 0.5)
]
}
@(close-eval the-eval)