From e074e454d5f8b5bc5dc45dccab1d138c5cd4ab0c Mon Sep 17 00:00:00 2001 From: Mirek Kratochvil Date: Tue, 15 Nov 2022 20:30:53 +0100 Subject: ok simplify the refs back --- app/Code.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'app/Code.hs') 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 -- cgit v1.2.3