summaryrefslogtreecommitdiff
path: root/app/Code.hs
diff options
context:
space:
mode:
Diffstat (limited to 'app/Code.hs')
-rw-r--r--app/Code.hs15
1 files changed, 11 insertions, 4 deletions
diff --git a/app/Code.hs b/app/Code.hs
index 94e8ce3..53d2e8f 100644
--- a/app/Code.hs
+++ b/app/Code.hs
@@ -11,12 +11,19 @@ data Datum
| HeapRef Int (Maybe Int) -- heap structure idx
deriving (Show, Eq, Ord)
+data BuiltinFunc =
+ BuiltinFunc (Interp -> Interp)
+
+instance Show BuiltinFunc where
+ show _ = "BuiltinFunc _"
+
data Instr
= U Datum -- something unifiable
- | NoGoal -- trivial goal
- | Goal -- we start a new goal, set up backtracking etc
- | Call -- all seems okay, call the goal
- | LastCall -- tail call the goal
+ | NoGoal -- trivial goal (directly after head)
+ | Builtin BuiltinFunc -- trivial goal (directly after head)
+ | Goal -- a new goal (set head)
+ | Call -- all seems okay, call the head's hoal
+ | LastCall -- tail call the head's goal
| Cut -- remove all alternative clauses of the current goal
deriving (Show)