mirror of
https://github.com/github/semantic.git
synced 2025-01-06 23:46:21 +03:00
Define builtin behaviours in runPrimitive.
This commit is contained in:
parent
54988fa3df
commit
22e01c9ed3
@ -78,5 +78,6 @@ prim builtin params = send (Prim builtin params)
|
|||||||
data Primitive value result where
|
data Primitive value result where
|
||||||
Prim :: Builtin -> [value] -> Primitive value value
|
Prim :: Builtin -> [value] -> Primitive value value
|
||||||
|
|
||||||
runPrimitive :: (Builtin -> [value] -> Evaluator location value effects value) -> Evaluator location value (Primitive value ': effects) a -> Evaluator location value effects a
|
runPrimitive :: (AbstractValue location value effects, Member Trace effects) => Evaluator location value (Primitive value ': effects) a -> Evaluator location value effects a
|
||||||
runPrimitive handler = interpret (\ (Prim builtin params) -> handler builtin params)
|
runPrimitive = interpret (\ (Prim builtin params) -> case builtin of
|
||||||
|
Print -> traverse (asString >=> trace . unpack) params >> unit)
|
||||||
|
Loading…
Reference in New Issue
Block a user