From e248226f442f289f3b7399411cdfd127a0de4d1a Mon Sep 17 00:00:00 2001 From: Mirek Kratochvil Date: Sat, 12 Nov 2022 19:02:45 +0100 Subject: o hello prlg --- app/Code.hs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'app/Code.hs') 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) -- cgit v1.2.3