chore: Code cleanup #164

Merged
aniva merged 5 commits from chore/cleanup into dev 2025-01-26 22:04:13 -08:00
1 changed files with 3 additions and 5 deletions
Showing only changes of commit 970c16a0a4 - Show all commits

View File

@ -12,7 +12,9 @@ structure State where
goalStates: Std.HashMap Nat GoalState := Std.HashMap.empty
/-- Main state monad for executing commands -/
abbrev MainM := ReaderT Context (StateT State Lean.CoreM)
abbrev MainM := ReaderT Context $ StateRefT State Lean.CoreM
/-- Fallible subroutine return type -/
abbrev CR α := Except Protocol.InteractionError α
def newGoalState (goalState: GoalState) : MainM Nat := do
let state ← get
@ -24,10 +26,6 @@ def newGoalState (goalState: GoalState) : MainM Nat := do
return stateId
-- HACK: For some reason writing `CommandM α := MainM (Except ... α)` disables
-- certain monadic features in `MainM`
abbrev CR α := Except Protocol.InteractionError α
def runMetaInMainM { α } (metaM: Lean.MetaM α): MainM α :=
metaM.run'
def runTermElabInMainM { α } (termElabM: Lean.Elab.TermElabM α) : MainM α :=