Documentation

Init.Data.Range.Polymorphic.PRange

The shape of a range's upper or lower bound: open, closed or unbounded.

  • open : BoundShape

    An open upper (or lower) bound of this shape requires elements of a range to be less than (or greater than) the bound, excluding the bound itself.

  • closed : BoundShape

    A closed upper (or lower) bound of this shape requires elements of a range to be less than or equal (or greater than or equal) to the bound.

  • unbounded : BoundShape

    This bound shape signifies the absence of a range bound, so that the range is unbounded in at least one direction.

Instances For

    The shape of a range, consisting of the shape of its upper and lower bounds.

    • lower : BoundShape

      The shape of the range's lower bound.

    • upper : BoundShape

      The shape of the range's upper bound.

    Instances For
      @[reducible, inline]
      abbrev Std.PRange.Bound (shape : BoundShape) (α : Type u) :

      An upper or lower bound in α of the given shape.

      Equations
      Instances For
        structure Std.PRange (shape : PRange.RangeShape) (α : Type u) :

        A range of elements of some type α. It is characterized by its upper and lower bounds, which may be inclusive, exclusive or absent.

        • a...=b is the range of elements greater than or equal to a and less than or equal to b.
        • a<...=b is the range of elements greater than a and less than or equal to b.
        • a...b or a...<b is the range of elements greater than or equal to a and less than b.
        • a<...b or a<...<b is the range of elements greater than a and less than b.
        • *...=b is the range of elements less than or equal to b.
        • *...b or *...<b is the range of elements less than b.
        • a...* is the range of elements greater than or equal to a.
        • a<...* is the range of elements greater than a.
        • *...* contains all elements of α.
        • lower : Bound shape.lower α

          The lower bound of the range.

        • upper : Bound shape.upper α

          The upper bound of the range.

        Instances For

          a...* is the range of elements greater than or equal to a. See also Std.PRange.

          Equations
          Instances For

            *...* is the range that is unbounded in both directions. See also Std.PRange.

            Equations
            Instances For

              a<...* is the range of elements greater than a. See also Std.PRange.

              Equations
              Instances For

                a...<b is the range of elements greater than or equal to a and less than b. See also Std.PRange.

                Equations
                Instances For

                  a...b is the range of elements greater than or equal to a and less than b. See also Std.PRange.

                  Equations
                  Instances For

                    *...<b is the range of elements less than b. See also Std.PRange.

                    Equations
                    Instances For

                      *...b is the range of elements less than b. See also Std.PRange.

                      Equations
                      Instances For

                        a<...<b is the range of elements greater than a and less than b. See also Std.PRange.

                        Equations
                        Instances For

                          a<...b is the range of elements greater than a and less than b. See also Std.PRange.

                          Equations
                          Instances For

                            a...=b is the range of elements greater than or equal to a and less than or equal to b. See also Std.PRange.

                            Equations
                            Instances For

                              *...=b is the range of elements less than or equal to b. See also Std.PRange.

                              Equations
                              Instances For

                                a<...=b is the range of elements greater than a and less than or equal to b. See also Std.PRange.

                                Equations
                                Instances For

                                  This typeclass provides decidable lower bound checks of the given shape.

                                  Instances are automatically provided in the following cases:

                                  Instances

                                    This typeclass provides decidable upper bound checks of the given shape.

                                    Instances are automatically provided in the following cases:

                                    Instances
                                      Equations
                                      • One or more equations did not get rendered due to their size.
                                      class Std.PRange.HasFiniteRanges (shape : BoundShape) (α : Type u_1) [SupportsUpperBound shape α] :

                                      This typeclass ensures that ranges with the given shape of upper bounds are always finite. This is a prerequisite for many functions and instances, such as PRange.toList or ForIn'.

                                      Instances
                                        class Std.PRange.BoundedUpwardEnumerable (lowerBoundShape : BoundShape) (α : Type u) :

                                        This typeclass will usually be used together with UpwardEnumerable α. It provides the starting point from which to enumerate all the values above the given lower bound.

                                        Instances are automatically generated in the following cases:

                                        • lowerBoundShape is .closed
                                        • lowerBoundShape is .open and there is an UpwardEnumerable α instance
                                        • lowerBoundShape is .unbounded and there is a Least? α instance
                                        Instances

                                          This typeclass ensures that the lower bound predicate from SupportsLowerBound sl α can be characterized in terms of UpwardEnumerable α and BoundedUpwardEnumerable sl α.

                                          Instances

                                            This typeclass ensures that if b is a transitive successor of a and b satisfies an upper bound of the given shape, then a also satisfies the upper bound.

                                            Instances

                                              This typeclass ensures that SupportsUpperBound .closed α and UpwardEnumerable α instances are compatible.

                                              Instances

                                                This typeclass ensures that SupportsUpperBound .open α and UpwardEnumerable α instances are compatible.

                                                Instances

                                                  This typeclass ensures that according to SupportsUpperBound .unbounded α, every element is in bounds.

                                                  Instances
                                                    Equations
                                                    • One or more equations did not get rendered due to their size.
                                                    Equations
                                                    • One or more equations did not get rendered due to their size.
                                                    Equations
                                                    • One or more equations did not get rendered due to their size.
                                                    Equations
                                                    • One or more equations did not get rendered due to their size.

                                                    This typeclass allows taking the intersection of ranges of the given shape and half-open ranges.

                                                    An element should be contained in the intersection if and only if it is contained in both ranges. This is encoded in LawfulClosedOpenIntersection.

                                                    Instances

                                                      This typeclass ensures that the intersection according to ClosedOpenIntersection shape α of two ranges contains exactly those elements that are contained in both ranges.

                                                      Instances