perf: missing annotations and helper instances
This commit is contained in:
parent
0a126b7702
commit
3f076fc836
4 changed files with 8 additions and 0 deletions
|
|
@ -42,6 +42,9 @@ structure CompilerM.Context where
|
|||
|
||||
abbrev CompilerM := ReaderT CompilerM.Context $ StateRefT CompilerM.State CoreM
|
||||
|
||||
@[alwaysInline]
|
||||
instance : Monad CompilerM := let i := inferInstanceAs (Monad CompilerM); { pure := i.pure, bind := i.bind }
|
||||
|
||||
@[inline] def withPhase (phase : Phase) (x : CompilerM α) : CompilerM α :=
|
||||
withReader (fun ctx => { ctx with phase }) x
|
||||
|
||||
|
|
|
|||
|
|
@ -75,6 +75,9 @@ structure State where
|
|||
|
||||
abbrev SimpM := ReaderT Context $ StateRefT State DiscrM
|
||||
|
||||
@[alwaysInline]
|
||||
instance : Monad SimpM := let i := inferInstanceAs (Monad SimpM); { pure := i.pure, bind := i.bind }
|
||||
|
||||
instance : MonadFVarSubst SimpM false where
|
||||
getSubst := return (← get).subst
|
||||
|
||||
|
|
|
|||
|
|
@ -76,6 +76,7 @@ abbrev CoreM := ReaderT Context <| StateRefT State (EIO Exception)
|
|||
|
||||
-- Make the compiler generate specialized `pure`/`bind` so we do not have to optimize through the
|
||||
-- whole monad stack at every use site. May eventually be covered by `deriving`.
|
||||
@[alwaysInline]
|
||||
instance : Monad CoreM := let i := inferInstanceAs (Monad CoreM); { pure := i.pure, bind := i.bind }
|
||||
|
||||
instance : Inhabited (CoreM α) where
|
||||
|
|
|
|||
|
|
@ -300,6 +300,7 @@ abbrev MetaM := ReaderT Context $ StateRefT State CoreM
|
|||
|
||||
-- Make the compiler generate specialized `pure`/`bind` so we do not have to optimize through the
|
||||
-- whole monad stack at every use site. May eventually be covered by `deriving`.
|
||||
@[alwaysInline]
|
||||
instance : Monad MetaM := let i := inferInstanceAs (Monad MetaM); { pure := i.pure, bind := i.bind }
|
||||
|
||||
instance : Inhabited (MetaM α) where
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue