mirror of
https://github.com/github/semantic.git
synced 2025-01-03 13:02:37 +03:00
Define a handler for Primitive effects.
This commit is contained in:
parent
fc5600e23c
commit
aea17bb2ec
@ -1,4 +1,4 @@
|
||||
{-# LANGUAGE GADTs #-}
|
||||
{-# LANGUAGE DataKinds, GADTs, TypeOperators #-}
|
||||
module Control.Abstract.Primitive where
|
||||
|
||||
import Control.Abstract.Addressable
|
||||
@ -74,3 +74,6 @@ defineBuiltins =
|
||||
|
||||
data Primitive value result where
|
||||
Prim :: Builtin -> 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)
|
||||
|
Loading…
Reference in New Issue
Block a user