chickadee » mini-kanren » make-tag-A

make-tag-A tag predprocedure

Constructs a goal that succeeds whenever pred returns #t for a single value, and fails if pred returns #f for that value. This creates a predicate-goal that tags the logic variable with the tag name tag.

Note: This is primarily useful for atomic-type predicates, i.e. predicates for atomic types that do not have explicit constructors. This is what is used to implement symbolo, for example:

(define symbolo (make-tag-A 'sym symbol?))

One should avoid using this for types that have constructors (e.g. pairs have cons, lists have list), and should instead prefer creating relational constructors for such types. This egg provides symbolo, numbero, booleano, charo, and atomo using this method. However, make-tag-A is highlighted here in case users have new atomic types that they wish to extend miniKanren with.