Documentation

Lake.Config.Pattern

Match Notation #

class Lake.IsPattern (α : Type u) (β : outParam (Type v)) :
Type (max u v)
  • satisfies (pat : α) (val : β) : Bool

    Returns whether the value matches the pattern.

Instances

    Returns whether the value matches the pattern.

    Equations
      Instances For

        Abstract Patterns #

        structure Lake.Pattern (α : Type u) (β : Type v) :
        Type (max u v)

        A pattern. Matches some subset of the values of a type. May also include a declarative description.

        • filter : αBool

          Returns whether the value matches the pattern.

        • name : Lean.Name

          An optional name for the filter.

        • descr? : Option (PatternDescr α β)

          A optional declarative description of the filter.

        Instances For
          instance Lake.instInhabitedPattern {a✝ : Type u_1} {a✝¹ : Type u_2} :
          Inhabited (Pattern a✝ a✝¹)
          Equations
            instance Lake.instInhabitedPatternDescr {a✝ : Type u_1} {a✝¹ : Type u_2} :
            Inhabited (PatternDescr a✝ a✝¹)
            Equations
              inductive Lake.PatternDescr (α : Type u) (β : Type v) :
              Type (max u v)

              An abstract declarative pattern. Augments another pattern description β with logical connectives.

              Instances For
                instance Lake.instCoePatternDescr {β : Type u_1} {α : Type u_2} :
                Coe β (PatternDescr α β)
                Equations
                  @[reducible, inline]
                  abbrev Lake.Pattern.matches {α : Type u_1} {β : Type u_2} (a : α) (self : Pattern α β) :

                  Returns whether the value matches the pattern. Alias for filter.

                  Equations
                    Instances For
                      instance Lake.instIsPatternPattern {α : Type u_1} {β : Type u_2} :
                      IsPattern (Pattern α β) α
                      Equations
                        @[specialize #[]]
                        def Lake.PatternDescr.matches {β : Type u_1} {α : Type u_2} [IsPattern β α] (val : α) (self : PatternDescr α β) :

                        Returns whether the value matches the pattern.

                        Equations
                          Instances For
                            instance Lake.instIsPatternPatternDescr {β : Type u_1} {α : Type u_2} [IsPattern β α] :
                            Equations
                              @[inline]
                              def Lake.Pattern.ofFn {α : Type u_1} {β : Type u_2} (f : αBool) (name : Lean.Name := Lean.Name.anonymous) :
                              Pattern α β

                              Matches a value that satisfies an arbitrary predicate (optionally identified by a Name).

                              Equations
                                Instances For
                                  instance Lake.instCoeForallBoolPattern {α : Type u_1} {β : Type u_2} :
                                  Coe (αBool) (Pattern α β)
                                  Equations
                                    @[inline]
                                    def Lake.Pattern.ofDescr {β : Type (max u_1 u_2)} {α : Type u_2} [IsPattern β α] (descr : PatternDescr α β) (name : Lean.Name := Lean.Name.anonymous) :
                                    Pattern α β

                                    Matches a string that satisfies the declarative pattern. (optionally identified by a Name).

                                    Equations
                                      Instances For
                                        instance Lake.instCoePatternDescrPatternOfIsPattern {β : Type (max u_1 u_2)} {α : Type u_1} [IsPattern β α] :
                                        Coe (PatternDescr α β) (Pattern α β)
                                        Equations
                                          @[inline]
                                          def Lake.Pattern.not {β : Type (max u_1 u_2)} {α : Type u_1} [IsPattern β α] (p : Pattern α β) :
                                          Pattern α β

                                          Matches a value that satisfies every pattern. Short-circuits.

                                          Equations
                                            Instances For
                                              @[inline]
                                              def Lake.Pattern.all {β : Type (max u_1 u_2)} {α : Type u_1} [IsPattern β α] (ps : Array (Pattern α β)) :
                                              Pattern α β

                                              Matches a value that satisfies every pattern. Short-circuits.

                                              Equations
                                                Instances For
                                                  @[inline]
                                                  def Lake.Pattern.any {β : Type (max u_1 u_2)} {α : Type u_1} [IsPattern β α] (ps : Array (Pattern α β)) :
                                                  Pattern α β

                                                  Matches a value that satisfies every pattern. Short-circuits.

                                                  Equations
                                                    Instances For
                                                      def Lake.PatternDescr.empty {α : Type u_1} {β : Type u_2} :

                                                      Matches nothing.

                                                      Equations
                                                        Instances For
                                                          def Lake.Pattern.empty {α : Type u_1} {β : Type u_2} :
                                                          Pattern α β

                                                          Matches nothing.

                                                          Equations
                                                            Instances For
                                                              Equations
                                                                instance Lake.instEmptyCollectionPattern {α : Type u_1} {β : Type u_2} :
                                                                Equations
                                                                  def Lake.PatternDescr.star {α : Type u_1} {β : Type u_2} :

                                                                  Matches everything.

                                                                  Equations
                                                                    Instances For
                                                                      def Lake.Pattern.star {α : Type u_1} {β : Type u_2} :
                                                                      Pattern α β

                                                                      Matches everything.

                                                                      Equations
                                                                        Instances For

                                                                          String Patterns #

                                                                          A declarative String pattern. Matches some subset of strings.

                                                                          Instances For

                                                                            Returns whether the string matches the pattern.

                                                                            Equations
                                                                              Instances For
                                                                                @[reducible, inline]

                                                                                A String pattern. Matches some subset of strings.

                                                                                Equations
                                                                                  Instances For
                                                                                    @[reducible, inline, deprecated Lake.Pattern.empty (since := "2025-03-27")]

                                                                                    Matches nothing.

                                                                                    Equations
                                                                                      Instances For
                                                                                        @[reducible, inline, deprecated Lake.Pattern.ofFn (since := "2025-03-27")]

                                                                                        Matches a value that satisfies an arbitrary predicate (optionally identified by a Name).

                                                                                        Equations
                                                                                          Instances For
                                                                                            @[inline]

                                                                                            Matches a string that is a member of the array

                                                                                            Equations
                                                                                              Instances For
                                                                                                @[inline]

                                                                                                Matches a string that starts with this prefix.

                                                                                                Equations
                                                                                                  Instances For
                                                                                                    @[inline]

                                                                                                    Matches a string that ends with this suffix.

                                                                                                    Equations
                                                                                                      Instances For

                                                                                                        Matches a string that is equal to this one.

                                                                                                        Equations
                                                                                                          Instances For
                                                                                                            @[inline]

                                                                                                            Matches a string that is a member of the array

                                                                                                            Equations
                                                                                                              Instances For

                                                                                                                File Path Patterns #

                                                                                                                A declarative FilePath pattern. Matches some subset of file paths.

                                                                                                                • path (p : StrPat) : PathPatDescr

                                                                                                                  Matches a file path whose normalized string representation satisfies the pattern.

                                                                                                                • extension (p : StrPat) : PathPatDescr

                                                                                                                  Matches a file path whose extension satisfies the pattern.

                                                                                                                • fileName (p : StrPat) : PathPatDescr

                                                                                                                  Matches a file path whose name satisfies the pattern.

                                                                                                                Instances For
                                                                                                                  @[inline]

                                                                                                                  Matches a file path that is equal to this one (when both are normalized).

                                                                                                                  Equations
                                                                                                                    Instances For

                                                                                                                      Returns whether the string matches the pattern.

                                                                                                                      Equations
                                                                                                                        Instances For
                                                                                                                          @[reducible, inline]

                                                                                                                          A FilePath pattern. Matches some subset of file paths.

                                                                                                                          Equations
                                                                                                                            Instances For
                                                                                                                              @[inline]

                                                                                                                              Matches a file path whose normalized string representation satisfies the pattern.

                                                                                                                              Equations
                                                                                                                                Instances For
                                                                                                                                  @[inline]

                                                                                                                                  Matches a file path whose extension satisfies the pattern.

                                                                                                                                  Equations
                                                                                                                                    Instances For
                                                                                                                                      @[inline]

                                                                                                                                      Matches a file path whose name satisfies the pattern.

                                                                                                                                      Equations
                                                                                                                                        Instances For

                                                                                                                                          Version-specific Patterns #

                                                                                                                                          Whether a string is "version-like". That is, a v followed by a digit.

                                                                                                                                          Equations
                                                                                                                                            Instances For

                                                                                                                                              Matches a "version-like" string: a v followed by a digit.

                                                                                                                                              Equations
                                                                                                                                                Instances For

                                                                                                                                                  Default string pattern for a Package's versionTags.

                                                                                                                                                  Equations
                                                                                                                                                    Instances For

                                                                                                                                                      Builtin StrPat presets available to TOML for versionTags.

                                                                                                                                                      Equations
                                                                                                                                                        Instances For