# PatternFunctions1(R, D)ΒΆ

- R: SetCategory
- D: Type

Tools for patterns.

- addBadValue: (Pattern R, D) -> Pattern R
`addBadValue(p, v)`

adds`v`

to the list of “bad values” for`p`

;`p`

is not allowed to match any of its “bad values”.

- badValues: Pattern R -> List D
`badValues(p)`

returns the list of “bad values” for`p`

;`p`

is not allowed to match any of its “bad values”.

- predicate: Pattern R -> D -> Boolean
`predicate(p)`

returns the predicate attached to`p`

, the constant function`true`

if`p`

has no predicates attached to it.

- satisfy?: (D, Pattern R) -> Boolean
`satisfy?(v, p)`

returns`f`

(`v`

) where`f`

is the predicate attached to`p`

.

- satisfy?: (List D, Pattern R) -> Boolean
`satisfy?([v1, ..., vn], p)`

returns`f(v1, ..., vn)`

where`f`

is the top-level predicate attached to`p`

.

- suchThat: (Pattern R, D -> Boolean) -> Pattern R
`suchThat(p, f)`

makes a copy of`p`

and adds the predicate`f`

to the copy, which is returned.