Version #
This module contains useful definitions for manipulating versions.
Parser Utils #
SemVerCore #
Equations
Instances For
Equations
Equations
- Lake.instReprSemVerCore = { reprPrec := Lake.instReprSemVerCore.repr }
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Instances For
Equations
- Lake.instOrdSemVerCore = { compare := Lake.instOrdSemVerCore.ord }
@[inline]
Equations
Instances For
Equations
- Lake.SemVerCore.instToString = { toString := Lake.SemVerCore.toString }
Equations
- Lake.SemVerCore.instToJson = { toJson := fun (x : Lake.SemVerCore) => Lean.Json.str x.toString }
Equations
- Lake.SemVerCore.instFromJson = { fromJson? := fun (x : Lean.Json) => do let __do_lift ← Lean.fromJson? x Lake.SemVerCore.parse __do_lift }
StdVer #
Instances For
Equations
- Lake.instInhabitedStdVer = { default := Lake.instInhabitedStdVer.default }
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lake.instReprStdVer = { reprPrec := Lake.instReprStdVer.repr }
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[reducible, inline]
A Lean version.
Equations
Instances For
Equations
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lake.StdVer.instOrd = { compare := Lake.StdVer.compare }
Equations
- Lake.StdVer.parseM s = do let core ← Lake.SemVerCore.parseM✝ s let specialDescr ← Lake.parseSpecialDescr✝ s pure { toSemVerCore := core, specialDescr := specialDescr }
Instances For
@[inline]
Equations
Instances For
Equations
- Lake.StdVer.instToString = { toString := Lake.StdVer.toString }
Equations
- Lake.StdVer.instToJson = { toJson := fun (x : Lake.StdVer) => Lean.Json.str x.toString }
Equations
- Lake.StdVer.instFromJson = { fromJson? := fun (x : Lean.Json) => do let __do_lift ← Lean.fromJson? x Lake.StdVer.parse __do_lift }
ToolchainVer #
The elan toolchain file name (i.e., lean-toolchain).
Equations
- Lake.toolchainFileName = { toString := "lean-toolchain" }
Instances For
Equations
- Lake.ToolchainVer.defaultOrigin = "leanprover/lean4"
Instances For
Equations
- Lake.ToolchainVer.prOrigin = "leanprover/lean4-pr-releases"
Instances For
@[implemented_by Lake.ToolchainVer.toString._override]
Equations
- (Lake.ToolchainVer.release ver).toString = toString Lake.ToolchainVer.defaultOrigin ++ toString ":v" ++ toString ver
- (Lake.ToolchainVer.nightly date).toString = toString Lake.ToolchainVer.defaultOrigin ++ toString ":nightly-" ++ toString date
- (Lake.ToolchainVer.pr n).toString = toString Lake.ToolchainVer.prOrigin ++ toString ":pr-release-" ++ toString n
- (Lake.ToolchainVer.other v).toString = v
Instances For
A Lean toolchain version.
- release (ver : LeanVer) : ToolchainVer
- nightly (date : Date) : ToolchainVer
- pr (n : Nat) : ToolchainVer
- other (v : String) : ToolchainVer
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lake.instReprToolchainVer = { reprPrec := Lake.instReprToolchainVer.repr }
Equations
- Lake.instDecidableEqToolchainVer.decEq (Lake.ToolchainVer.release a) (Lake.ToolchainVer.release b) = if h : a = b then h ▸ isTrue ⋯ else isFalse ⋯
- Lake.instDecidableEqToolchainVer.decEq (Lake.ToolchainVer.release ver) (Lake.ToolchainVer.nightly date) = isFalse ⋯
- Lake.instDecidableEqToolchainVer.decEq (Lake.ToolchainVer.release ver) (Lake.ToolchainVer.pr n) = isFalse ⋯
- Lake.instDecidableEqToolchainVer.decEq (Lake.ToolchainVer.release ver) (Lake.ToolchainVer.other v) = isFalse ⋯
- Lake.instDecidableEqToolchainVer.decEq (Lake.ToolchainVer.nightly date) (Lake.ToolchainVer.release ver) = isFalse ⋯
- Lake.instDecidableEqToolchainVer.decEq (Lake.ToolchainVer.nightly a) (Lake.ToolchainVer.nightly b) = if h : a = b then h ▸ isTrue ⋯ else isFalse ⋯
- Lake.instDecidableEqToolchainVer.decEq (Lake.ToolchainVer.nightly date) (Lake.ToolchainVer.pr n) = isFalse ⋯
- Lake.instDecidableEqToolchainVer.decEq (Lake.ToolchainVer.nightly date) (Lake.ToolchainVer.other v) = isFalse ⋯
- Lake.instDecidableEqToolchainVer.decEq (Lake.ToolchainVer.pr n) (Lake.ToolchainVer.release ver) = isFalse ⋯
- Lake.instDecidableEqToolchainVer.decEq (Lake.ToolchainVer.pr n) (Lake.ToolchainVer.nightly date) = isFalse ⋯
- Lake.instDecidableEqToolchainVer.decEq (Lake.ToolchainVer.pr a) (Lake.ToolchainVer.pr b) = if h : a = b then h ▸ isTrue ⋯ else isFalse ⋯
- Lake.instDecidableEqToolchainVer.decEq (Lake.ToolchainVer.pr n) (Lake.ToolchainVer.other v) = isFalse ⋯
- Lake.instDecidableEqToolchainVer.decEq (Lake.ToolchainVer.other v) (Lake.ToolchainVer.release ver) = isFalse ⋯
- Lake.instDecidableEqToolchainVer.decEq (Lake.ToolchainVer.other v) (Lake.ToolchainVer.nightly date) = isFalse ⋯
- Lake.instDecidableEqToolchainVer.decEq (Lake.ToolchainVer.other v) (Lake.ToolchainVer.pr n) = isFalse ⋯
- Lake.instDecidableEqToolchainVer.decEq (Lake.ToolchainVer.other a) (Lake.ToolchainVer.other b) = if h : a = b then h ▸ isTrue ⋯ else isFalse ⋯
Instances For
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
Parse a toolchain from a lean-toolchain file.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[inline]
Parse a toolchain from the lean-toolchain file of the directory dir.
Equations
Instances For
Equations
- Lake.ToolchainVer.instToString = { toString := Lake.ToolchainVer.toString }
Equations
- Lake.ToolchainVer.instToJson = { toJson := fun (x : Lake.ToolchainVer) => Lean.Json.str x.toString }
Equations
- Lake.ToolchainVer.instFromJson = { fromJson? := fun (x : Lean.Json) => Lake.ToolchainVer.ofString <$> Lean.fromJson? x }
Equations
- (Lake.ToolchainVer.release v1).blt (Lake.ToolchainVer.release v2) = decide (v1 < v2)
- (Lake.ToolchainVer.nightly d1).blt (Lake.ToolchainVer.nightly d2) = decide (d1 < d2)
- a.blt b = false
Instances For
Equations
- Lake.ToolchainVer.instLT = { lt := fun (x1 x2 : Lake.ToolchainVer) => x1.blt x2 = true }
Equations
- a.decLt b = decidable_of_bool (a.blt b) ⋯
Equations
- (Lake.ToolchainVer.release v1).ble (Lake.ToolchainVer.release v2) = decide (v1 ≤ v2)
- (Lake.ToolchainVer.nightly d1).ble (Lake.ToolchainVer.nightly d2) = decide (d1 ≤ d2)
- (Lake.ToolchainVer.pr n1).ble (Lake.ToolchainVer.pr n2) = decide (n1 = n2)
- (Lake.ToolchainVer.other v1).ble (Lake.ToolchainVer.other v2) = decide (v1 = v2)
- a.ble b = false
Instances For
Equations
- Lake.ToolchainVer.instLE = { le := fun (x1 x2 : Lake.ToolchainVer) => x1.ble x2 = true }
Equations
- a.decLe b = decidable_of_bool (a.ble b) ⋯
Converts a toolchain version to its normal form (e.g., with an origin).
Equations
Instances For
DecodeVersion #
Equations
- Lake.instDecodeVersionSemVerCore = { decodeVersion := Lake.SemVerCore.parse }
@[defaultInstance 1000]
Equations
- Lake.instDecodeVersionStdVer = { decodeVersion := Lake.StdVer.parse }
Equations
- Lake.instDecodeVersionToolchainVer = { decodeVersion := fun (x : String) => pure (Lake.ToolchainVer.ofString x) }
VerRange #
- lt : ComparatorOp
- le : ComparatorOp
- gt : ComparatorOp
- ge : ComparatorOp
- eq : ComparatorOp
- ne : ComparatorOp
Instances For
Equations
- Lake.instReprComparatorOp.repr Lake.ComparatorOp.lt prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "Lake.ComparatorOp.lt")).group prec✝
- Lake.instReprComparatorOp.repr Lake.ComparatorOp.le prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "Lake.ComparatorOp.le")).group prec✝
- Lake.instReprComparatorOp.repr Lake.ComparatorOp.gt prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "Lake.ComparatorOp.gt")).group prec✝
- Lake.instReprComparatorOp.repr Lake.ComparatorOp.ge prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "Lake.ComparatorOp.ge")).group prec✝
- Lake.instReprComparatorOp.repr Lake.ComparatorOp.eq prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "Lake.ComparatorOp.eq")).group prec✝
- Lake.instReprComparatorOp.repr Lake.ComparatorOp.ne prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "Lake.ComparatorOp.ne")).group prec✝
Instances For
Equations
- Lake.instReprComparatorOp = { reprPrec := Lake.instReprComparatorOp.repr }
Equations
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Instances For
Equations
- Lake.ComparatorOp.instToString = { toString := Lake.ComparatorOp.toString }
- innerMk :: (
- ver : Lake.StdVer
- op : Lake.ComparatorOp
- includeSuffixes : Bool
- )
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lake.instReprVerComparator = { reprPrec := Lake.instReprVerComparator.repr }
A version comparator that matches any non-suffixed version (i.e., *, ≥0.0.0).
Equations
- Lake.VerComparator.wild = { ver := Lake.StdVer.ofSemVerCore { }, op := Lake.ComparatorOp.ge }
Instances For
Equations
- Lake.VerComparator.instInhabited = { default := Lake.VerComparator.wild }
@[inline]
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- self.toString = toString (Lake.VerComparator.op✝ self) ++ toString (Lake.VerComparator.ver✝ self) ++ toString (if Lake.VerComparator.includeSuffixes✝ self = true then "-" else "")
Instances For
Equations
- Lake.VerComparator.instToString = { toString := Lake.VerComparator.toString }
- innerMk :: (
- toString : String
- clauses : Array (Array VerComparator)
- )
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lake.instReprVerRange = { reprPrec := Lake.instReprVerRange.repr }
Instances For
Equations
Equations
- Lake.VerRange.instToString = { toString := Lake.VerRange.toString }
Equations
- Lake.VerRange.ofClauses clauses = { toString := Lake.VerRange.ofClauses.fmtOrs✝ clauses, clauses := clauses }
Instances For
@[inline]
Equations
Instances For
Equations
- self.test ver = self.clauses.any fun (x : Array Lake.VerComparator) => x.all fun (x : Lake.VerComparator) => x.test ver