Equations
- Lean.JsonNumber.fromNat n = { mantissa := Int.ofNat n, exponent := 0 }
Instances For
Equations
- Lean.JsonNumber.fromInt n = { mantissa := n, exponent := 0 }
Instances For
Equations
Equations
Equations
- Lean.JsonNumber.instOfNatJsonNumber = { ofNat := Lean.JsonNumber.fromNat n }
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
- Lean.JsonNumber.ltProp = { lt := fun a b => Lean.JsonNumber.lt a b = true }
Instances For
instance
Lean.JsonNumber.instDecidableLtJsonNumberInstLTJsonNumber
(a : Lean.JsonNumber)
(b : Lean.JsonNumber)
:
Equations
Equations
- Lean.JsonNumber.instOrdJsonNumber = { compare := fun x y => if x < y then Ordering.lt else if x > y then Ordering.gt else Ordering.eq }
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Instances For
Equations
- Lean.JsonNumber.shiftr x x = match x, x with | { mantissa := m, exponent := e }, s => { mantissa := m, exponent := e + s }
Instances For
Equations
- Lean.JsonNumber.instToStringJsonNumber = { toString := Lean.JsonNumber.toString }
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
- Lean.JsonNumber.instNegJsonNumber = { neg := fun jn => { mantissa := -jn.mantissa, exponent := jn.exponent } }
Equations
- Lean.JsonNumber.instInhabitedJsonNumber = { default := 0 }
Equations
- Lean.JsonNumber.toFloat x = match x with | { mantissa := m, exponent := e } => (if m ≥ 0 then 1.0 else -1.0) * OfScientific.ofScientific (Int.natAbs m) true e
Instances For
Attempts to convert a float to a JsonNumber, if the number isn't finite returns the appropriate string from "NaN", "Infinity", "-Infinity".
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lean.strLt a b = decide (a < b)
Instances For
Equations
- Lean.instInhabitedJson = { default := Lean.Json.null }
Equations
- Lean.Json.instBEqJson = { beq := Lean.Json.beq' }
Equations
- Lean.Json.instCoeNatJson = { coe := fun n => Lean.Json.num (Lean.JsonNumber.fromNat n) }
Equations
- Lean.Json.instCoeIntJson = { coe := fun n => Lean.Json.num (Lean.JsonNumber.fromInt n) }
Equations
- Lean.Json.instCoeStringJson = { coe := Lean.Json.str }
Equations
- Lean.Json.instCoeBoolJson = { coe := Lean.Json.bool }
Equations
- Lean.Json.instOfNatJson = { ofNat := Lean.Json.num (Lean.JsonNumber.fromNat n) }
Equations
- Lean.Json.isNull x = match x with | Lean.Json.null => true | x => false
Instances For
Equations
- Lean.Json.getObj? x = match x with | Lean.Json.obj kvs => pure kvs | x => throw "object expected"
Instances For
Equations
- Lean.Json.getArr? x = match x with | Lean.Json.arr a => pure a | x => throw "array expected"
Instances For
Equations
- Lean.Json.getStr? x = match x with | Lean.Json.str s => pure s | x => throw "String expected"
Instances For
Equations
- Lean.Json.getNat? x = match x with | Lean.Json.num { mantissa := Int.ofNat n, exponent := 0 } => pure n | x => throw "Natural number expected"
Instances For
Equations
- Lean.Json.getInt? x = match x with | Lean.Json.num { mantissa := i, exponent := 0 } => pure i | x => throw "Integer expected"
Instances For
Equations
- Lean.Json.getBool? x = match x with | Lean.Json.bool b => pure b | x => throw "Bool expected"
Instances For
Equations
- Lean.Json.getNum? x = match x with | Lean.Json.num n => pure n | x => throw "number expected"
Instances For
Equations
Instances For
Assuming both inputs o₁, o₂
are json objects, will compute {...o₁, ...o₂}
.
If o₁
is not a json object, o₂
will be returned.
Equations
- Lean.Json.mergeObj x x = match x, x with | Lean.Json.obj kvs₁, Lean.Json.obj kvs₂ => Lean.Json.obj (Lean.RBNode.fold (Lean.RBNode.insert compare) kvs₁ kvs₂) | x, j₂ => j₂
Instances For
- arr: Array Lean.Json → Lean.Json.Structured
- obj: (Lean.RBNode String fun x => Lean.Json) → Lean.Json.Structured
Instances For
Equations
instance
Lean.Json.instCoeRBNodeStringJsonStructured :
Coe (Lean.RBNode String fun x => Lean.Json) Lean.Json.Structured