File: .lake/packages/lean4/src/lean/Lean/Compiler/LCNF/MonoTypes.lean

full_name: Lean.Compiler.LCNF.getRelevantCtorFields
code: /--
Given a constructor, return a bitmask `m` s.t. `m[i]` is true if field `i` is
computationally relevant.
-/
def getRelevantCtorFields (ctorName : Name) : CoreM (Array Bool) 
goal: Lean.CoreM (Array Bool)

full_name: Lean.Compiler.LCNF.instReprTrivialStructureInfo
code: /--
We say a structure has a trivial structure if it has not builtin support in the runtime,
it has only one constructor, and this constructor has only one relevant field.
-/
structure TrivialStructureInfo where
  ctorName  : Name
  numParams : Nat
  fieldIdx  : Nat
  deriving Inhabited, Repr
goal: Repr Lean.Compiler.LCNF.TrivialStructureInfo

full_name: Lean.Compiler.LCNF.instInhabitedTrivialStructureInfo
code: /--
We say a structure has a trivial structure if it has not builtin support in the runtime,
it has only one constructor, and this constructor has only one relevant field.
-/
structure TrivialStructureInfo where
  ctorName  : Name
  numParams : Nat
  fieldIdx  : Nat
  deriving Inhabited, Repr
goal: Inhabited Lean.Compiler.LCNF.TrivialStructureInfo

full_name: Lean.Compiler.LCNF.TrivialStructureInfo.fieldIdx
code: /--
We say a structure has a trivial structure if it has not builtin support in the runtime,
it has only one constructor, and this constructor has only one relevant field.
-/
structure TrivialStructureInfo where
  ctorName  : Name
  numParams : Nat
  fieldIdx  : Nat
  deriving Inhabited, Repr
goal: Nat

full_name: Lean.Compiler.LCNF.TrivialStructureInfo.ctorName
code: /--
We say a structure has a trivial structure if it has not builtin support in the runtime,
it has only one constructor, and this constructor has only one relevant field.
-/
structure TrivialStructureInfo where
  ctorName  : Name
  numParams : Nat
  fieldIdx  : Nat
  deriving Inhabited, Repr
goal: Lean.Name

full_name: Lean.Compiler.LCNF.TrivialStructureInfo.numParams
code: /--
We say a structure has a trivial structure if it has not builtin support in the runtime,
it has only one constructor, and this constructor has only one relevant field.
-/
structure TrivialStructureInfo where
  ctorName  : Name
  numParams : Nat
  fieldIdx  : Nat
  deriving Inhabited, Repr
goal: Nat

full_name: Lean.Compiler.LCNF.TrivialStructureInfo
code: /--
We say a structure has a trivial structure if it has not builtin support in the runtime,
it has only one constructor, and this constructor has only one relevant field.
-/
structure TrivialStructureInfo where
  ctorName  : Name
  numParams : Nat
  fieldIdx  : Nat
  deriving Inhabited, Repr
goal: Type

full_name: Lean.Compiler.LCNF.hasTrivialStructure?
code: /--
Return `some fieldIdx` if `declName` is the name of an inductive datatype s.t.
- It does not have builtin support in the runtime.
- It has only one constructor.
- This constructor has only one computationally relevant field.
-/
def hasTrivialStructure? (declName : Name) : CoreM (Option TrivialStructureInfo) 
goal: Lean.CoreM (Option Lean.Compiler.LCNF.TrivialStructureInfo)

full_name: Lean.Compiler.LCNF.getParamTypes
code: def getParamTypes (type : Expr) : Array Expr 
goal: Array Lean.Expr

full_name: Lean.Compiler.LCNF.getParamTypes.go
code: def getParamTypes (type : Expr) : Array Expr 
goal: Array Lean.Expr

full_name: Lean.Compiler.LCNF.toMonoType.visitApp
code: /--
Convert a LCNF type from the base phase to the mono phase.

LCNF types in the mono phase do not have dependencies,
and universe levels have been erased.

The type contains only `→` and constants.
-/
partial def toMonoType (type : Expr) : CoreM Expr 
goal: Lean.CoreM Lean.Expr

full_name: Lean.Compiler.LCNF.toMonoType
code: /--
Convert a LCNF type from the base phase to the mono phase.

LCNF types in the mono phase do not have dependencies,
and universe levels have been erased.

The type contains only `→` and constants.
-/
partial def toMonoType (type : Expr) : CoreM Expr 
goal: Lean.CoreM Lean.Expr

full_name: Lean.Compiler.LCNF.MonoTypeExtState.mono
code: /--
State for the environment extension used to save the LCNF mono phase type for declarations
that do not have code associated with them.
Example: constructors, inductive types, foreign functions.
-/
structure MonoTypeExtState where
  /-- The LCNF type for the `mono` phase. -/
  mono : PHashMap Name Expr := {}
  deriving Inhabited
goal: Lean.PHashMap Lean.Name Lean.Expr

full_name: Lean.Compiler.LCNF.MonoTypeExtState
code: /--
State for the environment extension used to save the LCNF mono phase type for declarations
that do not have code associated with them.
Example: constructors, inductive types, foreign functions.
-/
structure MonoTypeExtState where
  /-- The LCNF type for the `mono` phase. -/
  mono : PHashMap Name Expr := {}
  deriving Inhabited
goal: Type

full_name: Lean.Compiler.LCNF.instInhabitedMonoTypeExtState
code: /--
State for the environment extension used to save the LCNF mono phase type for declarations
that do not have code associated with them.
Example: constructors, inductive types, foreign functions.
-/
structure MonoTypeExtState where
  /-- The LCNF type for the `mono` phase. -/
  mono : PHashMap Name Expr := {}
  deriving Inhabited
goal: Inhabited Lean.Compiler.LCNF.MonoTypeExtState

full_name: Lean.Compiler.LCNF.initFn._@..lake.packages.lean4.src.lean.Lean.Compiler.LCNF.MonoTypes._hyg.1622
code: builtin_initialize monoTypeExt : EnvExtension MonoTypeExtState ←
  registerEnvExtension (pure {})
goal: IO (Lean.EnvExtension Lean.Compiler.LCNF.MonoTypeExtState)

full_name: Lean.Compiler.LCNF.monoTypeExt
code: builtin_initialize monoTypeExt : EnvExtension MonoTypeExtState ←
  registerEnvExtension (pure {})
goal: Lean.EnvExtension Lean.Compiler.LCNF.MonoTypeExtState

full_name: Lean.Compiler.LCNF.getOtherDeclMonoType
code: def getOtherDeclMonoType (declName : Name) : CoreM Expr 
goal: Lean.CoreM Lean.Expr