1
1
mirror of https://github.com/github/semantic.git synced 2024-11-28 10:15:55 +03:00

Primitive requests take parameters.

This commit is contained in:
Rob Rix 2018-05-28 10:48:17 -04:00
parent 116f64eb75
commit 9d36699682

View File

@ -72,11 +72,11 @@ defineBuiltins =
builtin Print (lambda lowerBound (\ v -> variable v >>= asString >>= trace . unpack >> unit))
prim :: Member (Primitive value) effects => Builtin -> Evaluator location value effects value
prim = send . Prim
prim :: Member (Primitive value) effects => Builtin -> [value] -> Evaluator location value effects value
prim builtin params = send (Prim builtin params)
data Primitive value result where
Prim :: Builtin -> Primitive value value
Prim :: Builtin -> [value] -> Primitive value value
runPrimitive :: (Builtin -> Evaluator location value effects value) -> Evaluator location value (Primitive value ': effects) a -> Evaluator location value effects a
runPrimitive handler = interpret (\ (Prim builtin) -> handler builtin)
runPrimitive :: (Builtin -> [value] -> Evaluator location value effects value) -> Evaluator location value (Primitive value ': effects) a -> Evaluator location value effects a
runPrimitive handler = interpret (\ (Prim builtin params) -> handler builtin params)