Abstract

  • Either is a sum type which holds either of two generic values.

    Example Usage

    let one = Either<String,Int>.left("one")
    let two = Either<String,Int>.right(2)
    
    See more

    Declaration

    Swift

    public enum Either<Left, Right>
    extension Either: Equatable where Left: Equatable, Right: Equatable
  • Implementation of Allen’s Interval Algebra.

    Background

    From Thomas A. Alspaugh:

    In 1983 James F. Allen published a paper in which he proposed thirteen basic relations between time intervals that are distinct, exhaustive, and qualitative.

    • Distinct because no pair of definite intervals can be related by more than one of the relationships
    • Exhaustive because any pair of definite intervals are described by one of the relations
    • Qualitative (rather than quantitative) because no numeric time spans are considered

    The naming conventions used in this implementation are those of Allen, refined by Krokhin et al..

    See more

    Declaration

    Swift

    public enum IntervalRelation : InvertibleEnum