aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Eval.hs
diff options
context:
space:
mode:
authorMarvin Borner2023-09-22 00:39:53 +0200
committerMarvin Borner2023-09-22 00:39:53 +0200
commit6a451b6cad18a5b4ba60b6017dbfaa4ab707db8a (patch)
tree6e13d6c502dbb1e89bf596c393ab27f33d4a9ee5 /src/Eval.hs
parent1f985159c3ca5d15a2229a495b2c15a5a1af2dd6 (diff)
Minor improvements
Sorry, don't exactly know and don't care. Just some things I apparently didn't commit
Diffstat (limited to 'src/Eval.hs')
-rw-r--r--src/Eval.hs15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/Eval.hs b/src/Eval.hs
index d887a62..6af1959 100644
--- a/src/Eval.hs
+++ b/src/Eval.hs
@@ -285,10 +285,23 @@ evalCommand inp s@(EnvState env@(Environment envDefs) conf cache) = \case
case res of
Left err -> print err
Right e' -> do
- red <- reduce e'
putStrLn $ toBinary e'
+ red <- reduce e'
putStrLn $ toBinary red
pure s
+ Jot str -> do
+ let e = fromJot str
+ let (res, _) = evalExp e (Environment M.empty) `runState` env
+ case res of
+ Left err -> print err
+ Right e' -> do
+ print e
+ print e'
+ print $ length $ toBinary e'
+ red <- reduce e'
+ print red
+ print $ length $ toBinary red
+ pure s
Time e -> do
start <- getTime Monotonic
let (res, _) = evalExp e (Environment M.empty) `runState` env