Documentation

Lean.MonadEnv

def Lean.setEnv {m : Type → Type} [MonadEnv m] (env : Environment) :
Instances For
    def Lean.withEnv {m : Type → Type} {α : Type} [Monad m] [MonadFinally m] [MonadEnv m] (env : Environment) (x : m α) :
    m α
    Instances For
      def Lean.isInductiveCore (env : Environment) (declName : Name) :
      Instances For
        def Lean.isInductive {m : Type → Type} [Monad m] [MonadEnv m] (declName : Name) :
        Instances For
          def Lean.isRecCore (env : Environment) (declName : Name) :
          Instances For
            def Lean.isRec {m : Type → Type} [Monad m] [MonadEnv m] (declName : Name) :
            Instances For
              @[inline]
              def Lean.withoutModifyingEnv {m : Type → Type} [Monad m] [MonadEnv m] [MonadFinally m] {α : Type} (x : m α) :
              m α
              Instances For
                @[inline]
                def Lean.withoutModifyingEnv' {m : Type → Type} [Monad m] [MonadEnv m] [MonadFinally m] {α : Type} (x : m α) :

                Similar to withoutModifyingEnv, but also returns the updated environment

                Instances For
                  @[inline]
                  def Lean.matchConst {m : Type → Type} {α : Type} [Monad m] [MonadEnv m] (e : Expr) (failK : Unit → m α) (k : ConstantInfo → List Level → m α) :
                  m α
                  Instances For
                    @[inline]
                    def Lean.matchConstInduct {m : Type → Type} {α : Type} [Monad m] [MonadEnv m] (e : Expr) (failK : Unit → m α) (k : InductiveVal → List Level → m α) :
                    m α
                    Instances For
                      @[inline]
                      def Lean.matchConstCtor {m : Type → Type} {α : Type} [Monad m] [MonadEnv m] (e : Expr) (failK : Unit → m α) (k : ConstructorVal → List Level → m α) :
                      m α
                      Instances For
                        @[inline]
                        def Lean.matchConstRec {m : Type → Type} {α : Type} [Monad m] [MonadEnv m] (e : Expr) (failK : Unit → m α) (k : RecursorVal → List Level → m α) :
                        m α
                        Instances For
                          def Lean.hasConst {m : Type → Type} [Monad m] [MonadEnv m] (constName : Name) (skipRealize : Bool := true) :
                          Instances For
                            def Lean.getConstInfo {m : Type → Type} [Monad m] [MonadEnv m] [MonadError m] (constName : Name) :
                            Instances For
                              def Lean.getConstVal {m : Type → Type} [Monad m] [MonadEnv m] [MonadError m] (constName : Name) :
                              Instances For
                                def Lean.getAsyncConstInfo {m : Type → Type} [Monad m] [MonadEnv m] [MonadError m] (constName : Name) (skipRealize : Bool := false) :
                                Instances For
                                  Instances For
                                    def Lean.isInductive? {m : Type → Type} [Monad m] [MonadEnv m] (declName : Name) :
                                    Instances For
                                      def Lean.isDefn? {m : Type → Type} [Monad m] [MonadEnv m] (constName : Name) :
                                      Instances For
                                        def Lean.isCtor? {m : Type → Type} [Monad m] [MonadEnv m] (constName : Name) :
                                        Instances For
                                          def Lean.isRec? {m : Type → Type} [Monad m] [MonadEnv m] (constName : Name) :
                                          Instances For
                                            def Lean.mkConstWithLevelParams {m : Type → Type} [Monad m] [MonadEnv m] [MonadError m] (constName : Name) :
                                            Instances For
                                              def Lean.getConstInfoDefn {m : Type → Type} [Monad m] [MonadEnv m] [MonadError m] (constName : Name) :
                                              Instances For
                                                def Lean.getConstInfoInduct {m : Type → Type} [Monad m] [MonadEnv m] [MonadError m] (constName : Name) :
                                                Instances For
                                                  def Lean.getConstInfoCtor {m : Type → Type} [Monad m] [MonadEnv m] [MonadError m] (constName : Name) :
                                                  Instances For
                                                    def Lean.getConstInfoRec {m : Type → Type} [Monad m] [MonadEnv m] [MonadError m] (constName : Name) :
                                                    Instances For
                                                      @[inline]
                                                      def Lean.matchConstStructure {m : Type → Type} {α : Type} [Monad m] [MonadEnv m] [MonadError m] (e : Expr) (failK : Unit → m α) (k : InductiveVal → List Level → 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.matchConstNonRecStructure for a more restrictive version.

                                                      Instances For
                                                        @[inline]
                                                        def Lean.matchConstNonRecStructure {m : Type → Type} {α : Type} [Monad m] [MonadEnv m] [MonadError m] (e : Expr) (failK : Unit → m α) (k : InductiveVal → List Level → ConstructorVal → m α) :
                                                        m α

                                                        Matches if e is a constant that is a non-recursive inductive type with no indices and with one constructor. Such a type satisfies Lean.isNonRecStructure. See also Lean.matchConstStructure for a less restrictive version.

                                                        Instances For
                                                          @[extern lean_has_compile_error]
                                                          opaque Lean.hasCompileError (env : Environment) (constName : Name) :
                                                          unsafe def Lean.evalConst {m : Type → Type} [Monad m] [MonadEnv m] [MonadError m] [MonadOptions m] (α : Type) (constName : Name) (checkMeta : Bool := true) :
                                                          m α
                                                          Instances For
                                                            unsafe def Lean.evalConstCheck {m : Type → Type} [Monad m] [MonadEnv m] [MonadError m] [MonadOptions m] (α : Type) (typeName constName : Name) :
                                                            m α
                                                            Instances For
                                                              def Lean.findModuleOf? {m : Type → Type} [Monad m] [MonadEnv m] [MonadError m] (declName : Name) :
                                                              Instances For
                                                                def Lean.isLargeEliminating {m : Type → Type} [Monad m] [MonadEnv m] [MonadError m] (declName : Name) :

                                                                Returns true if the recursor of the inductive type declName eliminates into an arbitrary Sort, which is the case exactly when it takes an extra universe parameter for the motive.

                                                                Constructions that turn a value of the type into data (T.ctorIdx, T._sizeOf_1, T.noConfusion, …) are only possible for such types.

                                                                Instances For
                                                                  def Lean.isEnumType {m : Type → Type} [Monad m] [MonadEnv m] [MonadError m] (declName : Name) :
                                                                  Instances For