1
1
mirror of https://github.com/github/semantic.git synced 2024-12-22 06:11:49 +03:00

Use .= to define localEvaluatingState.

This commit is contained in:
Rob Rix 2018-03-28 08:56:02 -04:00
parent 5ae24ddc89
commit 1d3c09a9d2

View File

@ -80,9 +80,9 @@ view lens = raise (gets (^. lens))
localEvaluatingState :: Member (State (EvaluatingState term value)) effects => Lens' (EvaluatingState term value) prj -> (prj -> prj) -> Evaluating term value effects a -> Evaluating term value effects a
localEvaluatingState lens f action = do
original <- view lens
raise (modify' (lens %~ f))
lens .= f original
v <- action
v <$ raise (modify' (lens .~ original))
v <$ lens .= original
instance Members '[Fail, State (EvaluatingState term value)] effects => MonadControl term (Evaluating term value effects) where