summaryrefslogtreecommitdiff
path: root/app/Code.hs
diff options
context:
space:
mode:
authorMirek Kratochvil <exa.exa@gmail.com>2022-11-15 20:30:53 +0100
committerMirek Kratochvil <exa.exa@gmail.com>2022-11-15 20:30:53 +0100
commite074e454d5f8b5bc5dc45dccab1d138c5cd4ab0c (patch)
tree3d12a566190bdcfa1672a5a5bf69bcc79259b50c /app/Code.hs
parent8d5353dc8c7ef3eefb0ae4860e67602c455c1a58 (diff)
downloadprlg-e074e454d5f8b5bc5dc45dccab1d138c5cd4ab0c.tar.gz
prlg-e074e454d5f8b5bc5dc45dccab1d138c5cd4ab0c.tar.bz2
ok simplify the refs back
Diffstat (limited to 'app/Code.hs')
-rw-r--r--app/Code.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/app/Code.hs b/app/Code.hs
index 5721d17..df3401e 100644
--- a/app/Code.hs
+++ b/app/Code.hs
@@ -9,9 +9,9 @@ import System.Console.Haskeline
data Datum
= Atom Int -- unifies a constant
| Struct Id -- unifies a structure with arity
- | VoidRef (Maybe Int) -- unifies with anything (references may refer to variable names)
- | LocalRef Int (Maybe Int) -- code-local variable idx (should not occur on heap)
- | HeapRef Int (Maybe Int) -- heap structure idx
+ | VoidRef -- unifies with anything
+ | LocalRef Int Int -- code-local variable idx (should never occur on heap)
+ | HeapRef Int -- something further on the heap
deriving (Show, Eq, Ord)
data Instr
@@ -34,7 +34,7 @@ data Heap =
emptyHeap = Heap 0 M.empty
-type Scope = M.Map Int Int
+type Scope = M.Map Int (Int, Int)
emptyScope :: Scope
emptyScope = M.empty