1
1
mirror of https://github.com/github/semantic.git synced 2025-01-03 04:51:57 +03:00

Simplify the carrier for runPythonPackaging.

This commit is contained in:
Rob Rix 2018-10-26 12:30:06 -04:00
parent 24660fca31
commit 37d4fea7b2

View File

@ -38,11 +38,10 @@ runPythonPackaging :: ( Carrier sig m
, Member (Reader Span) sig
, Member (Function term address (Value term address)) sig
)
=> Evaluator term address (Value term address) (InterposeC (Function term address (Value term address))
(Evaluator term address (Value term address) m)) a
=> Evaluator term address (Value term address) (InterposeC (Function term address (Value term address)) (Eff m)) a
-> Evaluator term address (Value term address) m a
runPythonPackaging = interpose (\case
Call callName super params k -> k =<< do
runPythonPackaging = raiseHandler $ interpose (runEvaluator . \case
Call callName super params k -> Evaluator . k =<< do
case callName of
Closure _ _ name' paramNames _ _ -> do
let bindings = foldr (uncurry Map.insert) lowerBound (zip paramNames params)
@ -63,9 +62,8 @@ runPythonPackaging = interpose (\case
_ -> pure ()
_ -> pure ()
call callName super params
Function name params body k -> function name params body >>= k
BuiltIn b k -> builtIn b >>= k)
. runEvaluator
Function name params body k -> function name params body >>= Evaluator . k
BuiltIn b k -> builtIn b >>= Evaluator . k)
interpose :: (Member eff sig, HFunctor eff, Carrier sig m)
=> (forall v. eff m (m v) -> m v)