File: .lake/packages/aesop/Aesop/Stats/Extension.lean

full_name: Aesop.StatsExtensionEntry
code: structure StatsExtensionEntry where
  /--
  The Aesop call for which stats were collected.
  -/
  aesopStx : Syntax
  /--
  The collected stats.
  -/
  stats : Stats
goal: Type

full_name: Aesop.StatsExtensionEntry.stats
code: structure StatsExtensionEntry where
  /--
  The Aesop call for which stats were collected.
  -/
  aesopStx : Syntax
  /--
  The collected stats.
  -/
  stats : Stats
goal: Aesop.Stats

full_name: Aesop.StatsExtensionEntry.aesopStx
code: structure StatsExtensionEntry where
  /--
  The Aesop call for which stats were collected.
  -/
  aesopStx : Syntax
  /--
  The collected stats.
  -/
  stats : Stats
goal: Lean.Syntax

full_name: Aesop.StatsArray
code: abbrev StatsArray 
goal: Type

full_name: Aesop.StatsExtensionState.currentEntries
code: structure StatsExtensionState where
  /--
  Entries for Aesop calls in the current module.
  -/
  currentEntries : List StatsExtensionEntry
  /--
  The size of `currentEntries`.
  -/
  currentEntriesSize : Nat
  /--
  Entries for Aesop calls in imported modules.
  -/
  importedEntries : Array (Array StatsExtensionEntry)
  deriving Inhabited
goal: List Aesop.StatsExtensionEntry

full_name: Aesop.StatsExtensionState.currentEntriesSize
code: structure StatsExtensionState where
  /--
  Entries for Aesop calls in the current module.
  -/
  currentEntries : List StatsExtensionEntry
  /--
  The size of `currentEntries`.
  -/
  currentEntriesSize : Nat
  /--
  Entries for Aesop calls in imported modules.
  -/
  importedEntries : Array (Array StatsExtensionEntry)
  deriving Inhabited
goal: Nat

full_name: Aesop.instInhabitedStatsExtensionState
code: structure StatsExtensionState where
  /--
  Entries for Aesop calls in the current module.
  -/
  currentEntries : List StatsExtensionEntry
  /--
  The size of `currentEntries`.
  -/
  currentEntriesSize : Nat
  /--
  Entries for Aesop calls in imported modules.
  -/
  importedEntries : Array (Array StatsExtensionEntry)
  deriving Inhabited
goal: Inhabited Aesop.StatsExtensionState

full_name: Aesop.StatsExtensionState
code: structure StatsExtensionState where
  /--
  Entries for Aesop calls in the current module.
  -/
  currentEntries : List StatsExtensionEntry
  /--
  The size of `currentEntries`.
  -/
  currentEntriesSize : Nat
  /--
  Entries for Aesop calls in imported modules.
  -/
  importedEntries : Array (Array StatsExtensionEntry)
  deriving Inhabited
goal: Type

full_name: Aesop.StatsExtensionState.importedEntries
code: structure StatsExtensionState where
  /--
  Entries for Aesop calls in the current module.
  -/
  currentEntries : List StatsExtensionEntry
  /--
  The size of `currentEntries`.
  -/
  currentEntriesSize : Nat
  /--
  Entries for Aesop calls in imported modules.
  -/
  importedEntries : Array (Array StatsExtensionEntry)
  deriving Inhabited
goal: Array (Array Aesop.StatsExtensionEntry)

full_name: Aesop.StatsExtensionState.toStatsArray
code: def toStatsArray (s : StatsExtensionState) : StatsArray 
goal: Aesop.StatsArray

full_name: Aesop.StatsExtensionState.empty
code: protected def empty : StatsExtensionState 
goal: Aesop.StatsExtensionState

full_name: Aesop.StatsExtensionState.instEmptyCollection
code: instance : EmptyCollection StatsExtensionState 
goal: EmptyCollection Aesop.StatsExtensionState

full_name: Aesop.StatsExtension
code: abbrev StatsExtension 
goal: Type

full_name: Aesop.initFn._@..lake.packages.aesop.Aesop.Stats.Extension._hyg.320
code: initialize statsExtension : StatsExtension ←
  registerPersistentEnvExtension {
    addEntryFn := λ state entry => { state with
      currentEntries := entry :: state.currentEntries
      currentEntriesSize := state.currentEntriesSize + 1
    }
    addImportedFn := λ importedEntries =>
      return { StatsExtensionState.empty with importedEntries }
    mkInitial := return ∅
    exportEntriesFn := λ state =>
      state.currentEntries.foldl (init := Array.mkEmpty state.currentEntriesSize)
        λ entries e => entries.push e
  }
goal: IO Aesop.StatsExtension

full_name: Aesop.statsExtension
code: initialize statsExtension : StatsExtension ←
  registerPersistentEnvExtension {
    addEntryFn := λ state entry => { state with
      currentEntries := entry :: state.currentEntries
      currentEntriesSize := state.currentEntriesSize + 1
    }
    addImportedFn := λ importedEntries =>
      return { StatsExtensionState.empty with importedEntries }
    mkInitial := return ∅
    exportEntriesFn := λ state =>
      state.currentEntries.foldl (init := Array.mkEmpty state.currentEntriesSize)
        λ entries e => entries.push e
  }
goal: Aesop.StatsExtension

full_name: Aesop.recordStatsIfEnabled
code: def recordStatsIfEnabled [Monad m] [MonadEnv m] [MonadOptions m]
    (s : StatsExtensionEntry) : m Unit 
goal: m Unit

full_name: Aesop.getStatsArray
code: def getStatsArray [Monad m] [MonadEnv m] : m StatsArray
goal: m Aesop.StatsArray