On this page:
Generic Relations
7.7

Generic Relations

Siddhartha Kasivajhula

 (require relation) package: Relation

This collection provides generic relations and type-agnostic operators. Out of the box, many Racket relations and operators are type-specific. For instance, < operates specifically on numbers, conversion of any datatype to a string must use a type-specific transformer like symbol->string, and likewise + operates specifically on numbers even though many datatypes sustain a natural notion of addition. This package provides a number of interfaces and utilities to override these default operators with generic versions. With a few exceptions, the generic operators provided in this collection are drop-in alternatives to the built-in ones.

    1 Equivalence Relations

      1.1 Interface

      1.2 Utilities

    2 Order Relations

      2.1 Interface

      2.2 Utilities

    3 Type Transformers

    4 Algebraic Operators

      4.1 Interfaces

        4.1.1 Concatenation

        4.1.2 Multiplication

        4.1.3 Addition

      4.2 Utilities