diff options
| author | Mirek Kratochvil <exa.exa@gmail.com> | 2022-11-12 19:02:45 +0100 |
|---|---|---|
| committer | Mirek Kratochvil <exa.exa@gmail.com> | 2022-11-12 19:02:45 +0100 |
| commit | e248226f442f289f3b7399411cdfd127a0de4d1a (patch) | |
| tree | 7dfbc33f3e49cf51f8f4616a245f633401326529 /app/Code.hs | |
| parent | a736c1e7b727876b0b05f0b413e2c914437df13a (diff) | |
| download | prlg-e248226f442f289f3b7399411cdfd127a0de4d1a.tar.gz prlg-e248226f442f289f3b7399411cdfd127a0de4d1a.tar.bz2 | |
o hello prlg
Diffstat (limited to 'app/Code.hs')
| -rw-r--r-- | app/Code.hs | 15 |
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) |
