feat: add withAtLeastMaxRecDepth

This commit is contained in:
Leonardo de Moura 2022-09-19 22:02:56 -07:00
parent 4c19fdbb97
commit 772beeeb29

View file

@ -235,6 +235,9 @@ end Core
export Core (CoreM mkFreshUserName checkMaxHeartbeats withCurrHeartbeats)
@[inline] def withAtLeastMaxRecDepth [MonadFunctorT CoreM m] (max : Nat) : m α → m α :=
monadMap (m := CoreM) <| withReader (fun ctx => { ctx with maxRecDepth := Nat.max max ctx.maxRecDepth })
@[inline] def catchInternalId [Monad m] [MonadExcept Exception m] (id : InternalExceptionId) (x : m α) (h : Exception → m α) : m α := do
try
x