Equations
- Lean.setEnv env = Lean.modifyEnv fun (x : Lean.Environment) => env
Instances For
def
Lean.withEnv
{m : Type → Type}
{α : Type}
[Monad m]
[MonadFinally m]
[Lean.MonadEnv m]
(env : Lean.Environment)
(x : m α)
:
m α
Equations
- Lean.withEnv env x = do let saved ← Lean.getEnv tryFinally (do Lean.setEnv env x) (Lean.setEnv saved)
Instances For
Equations
- Lean.isInductive declName = do let __do_lift ← Lean.getEnv match __do_lift.find? declName with | some (Lean.ConstantInfo.inductInfo val) => pure true | x => pure false
Instances For
Equations
- Lean.isRecCore env declName = match env.find? declName with | some (Lean.ConstantInfo.recInfo val) => true | x => false
Instances For
Equations
- Lean.isRec declName = do let __do_lift ← Lean.getEnv pure (Lean.isRecCore __do_lift declName)
Instances For
@[inline]
def
Lean.withoutModifyingEnv
{m : Type → Type}
[Monad m]
[Lean.MonadEnv m]
[MonadFinally m]
{α : Type}
(x : m α)
:
m α
Equations
- Lean.withoutModifyingEnv x = do let env ← Lean.getEnv tryFinally x (Lean.setEnv env)
Instances For
@[inline]
def
Lean.withoutModifyingEnv'
{m : Type → Type}
[Monad m]
[Lean.MonadEnv m]
[MonadFinally m]
{α : Type}
(x : m α)
:
m (α × Lean.Environment)
Similar to withoutModifyingEnv
, but also returns the updated environment
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[inline]
def
Lean.matchConst
{m : Type → Type}
{α : Type}
[Monad m]
[Lean.MonadEnv m]
(e : Lean.Expr)
(failK : Unit → m α)
(k : Lean.ConstantInfo → List Lean.Level → m α)
:
m α
Equations
- Lean.matchConst (Lean.Expr.const constName us) failK k = do let __do_lift ← Lean.getEnv match __do_lift.find? constName with | some cinfo => k cinfo us | none => failK ()
- Lean.matchConst e failK k = failK ()
Instances For
@[inline]
def
Lean.matchConstInduct
{m : Type → Type}
{α : Type}
[Monad m]
[Lean.MonadEnv m]
(e : Lean.Expr)
(failK : Unit → m α)
(k : Lean.InductiveVal → List Lean.Level → m α)
:
m α
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[inline]
def
Lean.matchConstCtor
{m : Type → Type}
{α : Type}
[Monad m]
[Lean.MonadEnv m]
(e : Lean.Expr)
(failK : Unit → m α)
(k : Lean.ConstructorVal → List Lean.Level → m α)
:
m α
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[inline]
def
Lean.matchConstRec
{m : Type → Type}
{α : Type}
[Monad m]
[Lean.MonadEnv m]
(e : Lean.Expr)
(failK : Unit → m α)
(k : Lean.RecursorVal → List Lean.Level → m α)
:
m α
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lean.hasConst constName = do let __do_lift ← Lean.getEnv pure (__do_lift.contains constName)
Instances For
def
Lean.mkAuxName
{m : Type → Type}
[Monad m]
[Lean.MonadEnv m]
(baseName : Lean.Name)
(idx : Nat)
:
Equations
- Lean.mkAuxName baseName idx = do let __do_lift ← Lean.getEnv pure (Lean.mkAuxNameAux __do_lift baseName idx)
Instances For
def
Lean.getConstInfo
{m : Type → Type}
[Monad m]
[Lean.MonadEnv m]
[Lean.MonadError m]
(constName : Lean.Name)
:
Equations
- One or more equations did not get rendered due to their size.
Instances For
def
Lean.mkConstWithLevelParams
{m : Type → Type}
[Monad m]
[Lean.MonadEnv m]
[Lean.MonadError m]
(constName : Lean.Name)
:
Equations
- Lean.mkConstWithLevelParams constName = do let info ← Lean.getConstInfo constName pure (Lean.mkConst constName (List.map Lean.mkLevelParam info.levelParams))
Instances For
def
Lean.getConstInfoDefn
{m : Type → Type}
[Monad m]
[Lean.MonadEnv m]
[Lean.MonadError m]
(constName : Lean.Name)
:
Equations
- One or more equations did not get rendered due to their size.
Instances For
def
Lean.getConstInfoInduct
{m : Type → Type}
[Monad m]
[Lean.MonadEnv m]
[Lean.MonadError m]
(constName : Lean.Name)
:
Equations
- One or more equations did not get rendered due to their size.
Instances For
def
Lean.getConstInfoCtor
{m : Type → Type}
[Monad m]
[Lean.MonadEnv m]
[Lean.MonadError m]
(constName : Lean.Name)
:
Equations
- One or more equations did not get rendered due to their size.
Instances For
def
Lean.getConstInfoRec
{m : Type → Type}
[Monad m]
[Lean.MonadEnv m]
[Lean.MonadError m]
(constName : Lean.Name)
:
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[inline]
def
Lean.matchConstStructure
{m : Type → Type}
{α : Type}
[Monad m]
[Lean.MonadEnv m]
[Lean.MonadError m]
(e : Lean.Expr)
(failK : Unit → m α)
(k : Lean.InductiveVal → List Lean.Level → Lean.ConstructorVal → m α)
:
m α
Matches if e
is a constant that is an inductive type with one constructor.
Such types can be used with primitive projections.
See also Lean.matchConstStructLike
for a more restrictive version.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[inline]
def
Lean.matchConstStructureLike
{m : Type → Type}
{α : Type}
[Monad m]
[Lean.MonadEnv m]
[Lean.MonadError m]
(e : Lean.Expr)
(failK : Unit → m α)
(k : Lean.InductiveVal → List Lean.Level → Lean.ConstructorVal → m α)
:
m α
Matches if e
is a constant that is an non-recursive inductive type with no indices and with one constructor.
Such a type satisfies Lean.isStructureLike
.
See also Lean.matchConstStructure
for a less restrictive version.
Equations
- One or more equations did not get rendered due to their size.
Instances For
unsafe def
Lean.evalConst
{m : Type → Type}
[Monad m]
[Lean.MonadEnv m]
[Lean.MonadError m]
[Lean.MonadOptions m]
(α : Type)
(constName : Lean.Name)
:
m α
Instances For
unsafe def
Lean.evalConstCheck
{m : Type → Type}
[Monad m]
[Lean.MonadEnv m]
[Lean.MonadError m]
[Lean.MonadOptions m]
(α : Type)
(typeName constName : Lean.Name)
:
m α
Instances For
def
Lean.findModuleOf?
{m : Type → Type}
[Monad m]
[Lean.MonadEnv m]
[Lean.MonadError m]
(declName : Lean.Name)
:
Equations
- One or more equations did not get rendered due to their size.
Instances For
def
Lean.isEnumType
{m : Type → Type}
[Monad m]
[Lean.MonadEnv m]
[Lean.MonadError m]
(declName : Lean.Name)
:
m Bool
Equations
- One or more equations did not get rendered due to their size.