Documentation

Lean.MonadEnv

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

                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 : TypeType} {α : Type} [Monad m] [MonadEnv m] (e : Expr) (failK : Unitm α) (k : ConstantInfoList Levelm α) :
                  m α
                  Equations
                  Instances For
                    @[inline]
                    def Lean.matchConstInduct {m : TypeType} {α : Type} [Monad m] [MonadEnv m] (e : Expr) (failK : Unitm α) (k : InductiveValList Levelm α) :
                    m α
                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For
                      @[inline]
                      def Lean.matchConstCtor {m : TypeType} {α : Type} [Monad m] [MonadEnv m] (e : Expr) (failK : Unitm α) (k : ConstructorValList Levelm α) :
                      m α
                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For
                        @[inline]
                        def Lean.matchConstRec {m : TypeType} {α : Type} [Monad m] [MonadEnv m] (e : Expr) (failK : Unitm α) (k : RecursorValList Levelm α) :
                        m α
                        Equations
                        • One or more equations did not get rendered due to their size.
                        Instances For
                          def Lean.hasConst {m : TypeType} [Monad m] [MonadEnv m] (constName : Name) (skipRealize : Bool := true) :
                          Equations
                          Instances For
                            def Lean.getConstInfo {m : TypeType} [Monad m] [MonadEnv m] [MonadError m] (constName : Name) :
                            Equations
                            Instances For
                              def Lean.getConstVal {m : TypeType} [Monad m] [MonadEnv m] [MonadError m] (constName : Name) :
                              Equations
                              Instances For
                                def Lean.getAsyncConstInfo {m : TypeType} [Monad m] [MonadEnv m] [MonadError m] (constName : Name) (skipRealize : Bool := false) :
                                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
                                    def Lean.isInductive? {m : TypeType} [Monad m] [MonadEnv m] (declName : Name) :
                                    Equations
                                    Instances For
                                      def Lean.isDefn? {m : TypeType} [Monad m] [MonadEnv m] (constName : Name) :
                                      Equations
                                      • One or more equations did not get rendered due to their size.
                                      Instances For
                                        def Lean.isCtor? {m : TypeType} [Monad m] [MonadEnv m] (constName : Name) :
                                        Equations
                                        • One or more equations did not get rendered due to their size.
                                        Instances For
                                          def Lean.isRec? {m : TypeType} [Monad m] [MonadEnv m] (constName : Name) :
                                          Equations
                                          • One or more equations did not get rendered due to their size.
                                          Instances For
                                            def Lean.mkConstWithLevelParams {m : TypeType} [Monad m] [MonadEnv m] [MonadError m] (constName : Name) :
                                            Equations
                                            Instances For
                                              def Lean.getConstInfoDefn {m : TypeType} [Monad m] [MonadEnv m] [MonadError m] (constName : Name) :
                                              Equations
                                              • One or more equations did not get rendered due to their size.
                                              Instances For
                                                def Lean.getConstInfoInduct {m : TypeType} [Monad m] [MonadEnv m] [MonadError m] (constName : Name) :
                                                Equations
                                                • One or more equations did not get rendered due to their size.
                                                Instances For
                                                  def Lean.getConstInfoCtor {m : TypeType} [Monad m] [MonadEnv m] [MonadError m] (constName : Name) :
                                                  Equations
                                                  • One or more equations did not get rendered due to their size.
                                                  Instances For
                                                    def Lean.getConstInfoRec {m : TypeType} [Monad m] [MonadEnv m] [MonadError m] (constName : Name) :
                                                    Equations
                                                    • One or more equations did not get rendered due to their size.
                                                    Instances For
                                                      @[inline]
                                                      def Lean.matchConstStructure {m : TypeType} {α : Type} [Monad m] [MonadEnv m] [MonadError m] (e : Expr) (failK : Unitm α) (k : InductiveValList LevelConstructorValm α) :
                                                      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.

                                                      Equations
                                                      • One or more equations did not get rendered due to their size.
                                                      Instances For
                                                        @[inline]
                                                        def Lean.matchConstNonRecStructure {m : TypeType} {α : Type} [Monad m] [MonadEnv m] [MonadError m] (e : Expr) (failK : Unitm α) (k : InductiveValList LevelConstructorValm α) :
                                                        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.

                                                        Equations
                                                        • One or more equations did not get rendered due to their size.
                                                        Instances For
                                                          @[extern lean_has_compile_error]
                                                          opaque Lean.hasCompileError (env : Environment) (constName : Name) :
                                                          unsafe def Lean.evalConst {m : TypeType} [Monad m] [MonadEnv m] [MonadError m] [MonadOptions m] (α : Type) (constName : Name) (checkMeta : Bool := true) :
                                                          m α
                                                          Equations
                                                          • One or more equations did not get rendered due to their size.
                                                          Instances For
                                                            unsafe def Lean.evalConstCheck {m : TypeType} [Monad m] [MonadEnv m] [MonadError m] [MonadOptions m] (α : Type) (typeName constName : Name) :
                                                            m α
                                                            Equations
                                                            • One or more equations did not get rendered due to their size.
                                                            Instances For
                                                              def Lean.findModuleOf? {m : TypeType} [Monad m] [MonadEnv m] [MonadError m] (declName : Name) :
                                                              Equations
                                                              • One or more equations did not get rendered due to their size.
                                                              Instances For
                                                                def Lean.isLargeEliminating {m : TypeType} [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.

                                                                Equations
                                                                • One or more equations did not get rendered due to their size.
                                                                Instances For
                                                                  def Lean.isEnumType {m : TypeType} [Monad m] [MonadEnv m] [MonadError m] (declName : Name) :
                                                                  Equations
                                                                  • One or more equations did not get rendered due to their size.
                                                                  Instances For