On this page:
Generic Relations

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 Logical Relations

    2 Equivalence Relations

      2.1 Interface

      2.2 Utilities

    3 Order Relations

      3.1 Interface

      3.2 Utilities

    4 Functional Primitives

      4.1 Types

      4.2 Utilities

    5 Type Transformers

    6 Composing Operations

      6.1 Interfaces

        6.1.1 Concatenation

        6.1.2 Multiplication

        6.1.3 Addition

      6.2 Utilities