diff options
| author | Mirek Kratochvil <exa.exa@gmail.com> | 2023-03-05 21:34:20 +0100 |
|---|---|---|
| committer | Mirek Kratochvil <exa.exa@gmail.com> | 2023-03-05 21:34:20 +0100 |
| commit | 98c40f4bf8849f5cdd3d3c49123bc911b8fa42e1 (patch) | |
| tree | e41a1cd05d17765f9e27b0844580655b2dc1ae95 /app/Interpreter.hs | |
| parent | 45c3f81891837820aea7c3dbd45e3bae25fc4c22 (diff) | |
| download | prlg-98c40f4bf8849f5cdd3d3c49123bc911b8fa42e1.tar.gz prlg-98c40f4bf8849f5cdd3d3c49123bc911b8fa42e1.tar.bz2 | |
strings and a few other small nice changes
Diffstat (limited to 'app/Interpreter.hs')
| -rw-r--r-- | app/Interpreter.hs | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/app/Interpreter.hs b/app/Interpreter.hs index 2ad0118..440b6fa 100644 --- a/app/Interpreter.hs +++ b/app/Interpreter.hs @@ -8,6 +8,7 @@ import Code , Cho(..) , Code , Datum(..) + , Id(..) , Instr(..) , InterpFn , emptyHeap @@ -18,7 +19,7 @@ import Control.Monad (when) import qualified Data.Map as M import Env (PrlgEnv) import Heap -import IR (Id(..), StrTable(..)) +import IR (StrTable(..)) import Lens.Micro import Lens.Micro.Mtl @@ -145,7 +146,7 @@ cutHead = do cutGoal = doCut >> advance -openGoal :: IR.Id -> InterpFn +openGoal :: Id -> InterpFn openGoal fn = do def <- (M.!? fn) <$> use defs case def of @@ -244,13 +245,10 @@ uOK = uNext >> continue unify :: Datum -> Datum -> InterpFn unify VoidRef VoidRef = uOK -unify (Atom _) VoidRef = uOK -unify VoidRef (Atom _) = uOK -unify (Atom a) (Atom b) +unify (C _) VoidRef = uOK +unify VoidRef (C _) = uOK +unify (C a) (C b) | a == b = uOK -unify (Number _) VoidRef = uOK -unify VoidRef (Number _) = uOK -unify (Number a) (Number b) | a == b = uOK unify (Struct a) VoidRef = do uNext |
