File: .lake/packages/lean4/src/lean/Lean/Util/MonadCache.lean

full_name: Lean.MonadCache.findCached?
code: /-- Interface for caching results.  -/
class MonadCache (α β : Type) (m : Type → Type) where
  findCached? : α → m (Option β)
  cache       : α → β → m Unit
goal: α → m (Option β)

full_name: Lean.MonadCache.cache
code: /-- Interface for caching results.  -/
class MonadCache (α β : Type) (m : Type → Type) where
  findCached? : α → m (Option β)
  cache       : α → β → m Unit
goal: α → β → m Unit

full_name: Lean.MonadCache
code: /-- Interface for caching results.  -/
class MonadCache (α β : Type) (m : Type → Type) where
  findCached? : α → m (Option β)
  cache       : α → β → m Unit
goal: Type

full_name: Lean.checkCache
code: /-- If entry `a := b` is already in the cache, then return `b`.
    Otherwise, execute `b ← f ()`, store `a := b` in the cache and return `b`. -/
@[always_inline, inline]
def checkCache {α β : Type} {m : Type → Type} [MonadCache α β m] [Monad m] (a : α) (f : Unit → m β) : m β 
goal: m β

full_name: Lean.instMonadCacheReaderT
code: instance {α β ρ : Type} {m : Type → Type} [MonadCache α β m] : MonadCache α β (ReaderT ρ m) 
goal: Lean.MonadCache α β (ReaderT ρ m)

full_name: Lean.instMonadCacheExceptTOfMonad
code: @[always_inline]
instance {α β ε : Type} {m : Type → Type} [MonadCache α β m] [Monad m] : MonadCache α β (ExceptT ε m) 
goal: Lean.MonadCache α β (ExceptT ε m)

full_name: Lean.MonadHashMapCacheAdapter.getCache
code: /-- Adapter for implementing `MonadCache` interface using `HashMap`s.
    We just have to specify how to extract/modify the `HashMap`. -/
class MonadHashMapCacheAdapter (α β : Type) (m : Type → Type) [BEq α] [Hashable α] where
  getCache    : m (HashMap α β)
  modifyCache : (HashMap α β → HashMap α β) → m Unit
goal: m (Lean.HashMap α β)

full_name: Lean.MonadHashMapCacheAdapter
code: /-- Adapter for implementing `MonadCache` interface using `HashMap`s.
    We just have to specify how to extract/modify the `HashMap`. -/
class MonadHashMapCacheAdapter (α β : Type) (m : Type → Type) [BEq α] [Hashable α] where
  getCache    : m (HashMap α β)
  modifyCache : (HashMap α β → HashMap α β) → m Unit
goal: Type

full_name: Lean.MonadHashMapCacheAdapter.modifyCache
code: /-- Adapter for implementing `MonadCache` interface using `HashMap`s.
    We just have to specify how to extract/modify the `HashMap`. -/
class MonadHashMapCacheAdapter (α β : Type) (m : Type → Type) [BEq α] [Hashable α] where
  getCache    : m (HashMap α β)
  modifyCache : (HashMap α β → HashMap α β) → m Unit
goal: (Lean.HashMap α β → Lean.HashMap α β) → m Unit

full_name: Lean.MonadHashMapCacheAdapter.findCached?
code: @[always_inline, inline]
def findCached? {α β : Type} {m : Type → Type} [BEq α] [Hashable α] [Monad m] [MonadHashMapCacheAdapter α β m] (a : α) : m (Option β) 
goal: m (Option β)

full_name: Lean.MonadHashMapCacheAdapter.cache
code: @[always_inline, inline]
def cache {α β : Type} {m : Type → Type} [BEq α] [Hashable α] [MonadHashMapCacheAdapter α β m] (a : α) (b : β) : m Unit 
goal: m Unit

full_name: Lean.MonadHashMapCacheAdapter.instMonadCacheOfMonad
code: instance {α β : Type} {m : Type → Type} [BEq α] [Hashable α] [Monad m] [MonadHashMapCacheAdapter α β m] : MonadCache α β m 
goal: Lean.MonadCache α β m

full_name: Lean.MonadCacheT
code: def MonadCacheT {ω} (α β : Type) (m : Type → Type) [STWorld ω m] [BEq α] [Hashable α] 
goal: Type → Type

full_name: Lean.MonadCacheT.instMonadHashMapCacheAdapter
code: instance  : MonadHashMapCacheAdapter α β (MonadCacheT α β m) 
goal: Lean.MonadHashMapCacheAdapter α β (Lean.MonadCacheT α β m)

full_name: Lean.MonadCacheT.run
code: @[inline] def run {σ} (x : MonadCacheT α β m σ) : m σ 
goal: m σ

full_name: Lean.MonadCacheT.instMonad
code: instance : Monad (MonadCacheT α β m) 
goal: Monad (Lean.MonadCacheT α β m)

full_name: Lean.MonadCacheT.instMonadLift
code: instance : MonadLift m (MonadCacheT α β m) 
goal: MonadLift m (Lean.MonadCacheT α β m)

full_name: Lean.MonadCacheT.instMonadExceptOf
code: instance (ε) [MonadExceptOf ε m] : MonadExceptOf ε (MonadCacheT α β m) 
goal: MonadExceptOf ε (Lean.MonadCacheT α β m)

full_name: Lean.MonadCacheT.instMonadControl
code: instance : MonadControl m (MonadCacheT α β m) 
goal: MonadControl m (Lean.MonadCacheT α β m)

full_name: Lean.MonadCacheT.instMonadFinally
code: instance [MonadFinally m] : MonadFinally (MonadCacheT α β m) 
goal: MonadFinally (Lean.MonadCacheT α β m)

full_name: Lean.MonadCacheT.instMonadRef
code: instance [MonadRef m] : MonadRef (MonadCacheT α β m) 
goal: Lean.MonadRef (Lean.MonadCacheT α β m)

full_name: Lean.MonadCacheT.instAlternative
code: instance [Alternative m] : Alternative (MonadCacheT α β m) 
goal: Alternative (Lean.MonadCacheT α β m)

full_name: Lean.MonadStateCacheT
code: def MonadStateCacheT (α β : Type) (m : Type → Type) [BEq α] [Hashable α] 
goal: Type → Type

full_name: Lean.MonadStateCacheT.instMonadHashMapCacheAdapter
code: instance  : MonadHashMapCacheAdapter α β (MonadStateCacheT α β m) 
goal: Lean.MonadHashMapCacheAdapter α β (Lean.MonadStateCacheT α β m)

full_name: Lean.MonadStateCacheT.run
code: @[always_inline, inline] def run {σ} (x : MonadStateCacheT α β m σ) : m σ 
goal: m σ

full_name: Lean.MonadStateCacheT.instMonad
code: instance : Monad (MonadStateCacheT α β m) 
goal: Monad (Lean.MonadStateCacheT α β m)

full_name: Lean.MonadStateCacheT.instMonadLift
code: instance : MonadLift m (MonadStateCacheT α β m) 
goal: MonadLift m (Lean.MonadStateCacheT α β m)

full_name: Lean.MonadStateCacheT.instMonadExceptOf
code: instance (ε) [MonadExceptOf ε m] : MonadExceptOf ε (MonadStateCacheT α β m) 
goal: MonadExceptOf ε (Lean.MonadStateCacheT α β m)

full_name: Lean.MonadStateCacheT.instMonadControl
code: instance : MonadControl m (MonadStateCacheT α β m) 
goal: MonadControl m (Lean.MonadStateCacheT α β m)

full_name: Lean.MonadStateCacheT.instMonadFinally
code: instance [MonadFinally m] : MonadFinally (MonadStateCacheT α β m) 
goal: MonadFinally (Lean.MonadStateCacheT α β m)

full_name: Lean.MonadStateCacheT.instMonadRef
code: instance [MonadRef m] : MonadRef (MonadStateCacheT α β m) 
goal: Lean.MonadRef (Lean.MonadStateCacheT α β m)