Equations
- ShareCommon.Object.ptrEq a b = (ptrAddrUnsafe a == ptrAddrUnsafe b)
@[inline]
Equations
- Map : Type
- Set : Type
- mapFind? : Map → ShareCommon.Object → Option ShareCommon.Object
- mapInsert : Map → ShareCommon.Object → ShareCommon.Object → Map
- setFind? : Set → ShareCommon.Object → Option ShareCommon.Object
- setInsert : Set → ShareCommon.Object → Set
Instances For
@[inline]
@[extern lean_sharecommon_eq]
@[extern lean_sharecommon_hash]
Instances For
Equations
- One or more equations did not get rendered due to their size.
@[implemented_by ShareCommon.StateFactory.mkImpl]
Equations
- ShareCommon.StateFactory.get = unsafeCast
Internally State
is implemented as a pair ObjectMap
and ObjectSet
@[inline]
Equations
@[implemented_by ShareCommon.mkStateImpl]
Equations
- ShareCommon.instInhabitedState = { default := ShareCommon.State.mk σ }
@[extern lean_state_sharecommon]
def
ShareCommon.State.shareCommon
{α : Type u_1}
{σ : ShareCommon.StateFactory}
(s : ShareCommon.State σ)
(a : α)
:
α × ShareCommon.State σ
Equations
- ShareCommon.State.shareCommon s a = (a, s)
@[inline]
abbrev
withShareCommon
{m : Type u_1 → Type u_2}
[self : MonadShareCommon m]
{α : Type u_1}
:
α → m α
@[inline]
abbrev
shareCommonM
{m : Type u_1 → Type u_2}
{α : Type u_1}
[inst : MonadShareCommon m]
(a : α)
:
m α
Equations
@[inline]
Equations
- ShareCommonT σ m = StateT (ShareCommon.State σ) m
@[inline]
Equations
- ShareCommonM σ = ShareCommonT σ Id
@[specialize #[]]
def
ShareCommonT.withShareCommon
{m : Type u_1 → Type u_2}
{α : Type u_1}
{σ : ShareCommon.StateFactory}
[inst : Monad m]
(a : α)
:
ShareCommonT σ m α
Equations
- ShareCommonT.withShareCommon a = modifyGet fun s => ShareCommon.State.shareCommon s a
instance
ShareCommonT.monadShareCommon
{m : Type u_1 → Type u_2}
{σ : ShareCommon.StateFactory}
[inst : Monad m]
:
MonadShareCommon (ShareCommonT σ m)
Equations
- ShareCommonT.monadShareCommon = { withShareCommon := fun {α} => ShareCommonT.withShareCommon }
@[inline]
def
ShareCommonT.run
{m : Type u_1 → Type u_2}
{σ : ShareCommon.StateFactory}
{α : Type u_1}
[inst : Monad m]
(x : ShareCommonT σ m α)
:
m α
Equations
- ShareCommonT.run x = StateT.run' x default
@[inline]