lean4-htt/tests/lean/run/944.lean
2022-09-26 05:46:04 -07:00

41 lines
806 B
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import Lean
def f1 (x : Nat) : Except String Nat :=
if x > 0 then
.ok x
else
.error "argument is zero"
namespace Lean.Elab
open Lsp
def identOf : Info → Option (RefIdent × Bool)
| .ofTermInfo ti => match ti.expr with
| .const n .. => some (.const n, ti.isBinder)
| .fvar id .. => some (.fvar id, ti.isBinder)
| _ => none
| .ofFieldInfo fi => some (.const fi.projName, false)
| _ => none
def isConst (e : Expr) : Bool :=
e matches .const ..
def isImplicit (bi : BinderInfo) : Bool :=
bi matches .implicit
end Lean.Elab
def f2 (xs : List Nat) : List Nat :=
.map (· + 1) xs
def f2' (xs : List Nat) : List Nat :=
.map .succ xs
def f3 : Nat :=
.zero
def f4 (x : Nat) : Nat :=
.succ x
example (xs : List α) : Lean.RBTree α ord :=
xs.foldl .insert ∅