aboutsummaryrefslogtreecommitdiff
path: root/hsm-repl/Test/Repl.hs
diff options
context:
space:
mode:
authorPaul Oliver <contact@pauloliver.dev>2025-07-02 15:06:35 +0200
committerPaul Oliver <contact@pauloliver.dev>2025-08-13 23:54:10 +0000
commit8fe62292f18f4577303a868a8557b0486b218bcb (patch)
treecb9a9108eea479e932f37d03cf399b680e3886b2 /hsm-repl/Test/Repl.hs
parent0be7f1274e0cb8406bd4262b86d5e2e9dda77d7a (diff)
Code now uses `effectful` to manage side-effects
Diffstat (limited to 'hsm-repl/Test/Repl.hs')
-rw-r--r--hsm-repl/Test/Repl.hs15
1 files changed, 15 insertions, 0 deletions
diff --git a/hsm-repl/Test/Repl.hs b/hsm-repl/Test/Repl.hs
new file mode 100644
index 0000000..9052ef1
--- /dev/null
+++ b/hsm-repl/Test/Repl.hs
@@ -0,0 +1,15 @@
+import Control.Monad (void)
+import Control.Monad.Loops (whileJust_)
+import Data.Function ((&))
+import Effectful (runEff)
+import Effectful.Resource (runResource)
+import Hsm.Log (Severity (Trace), runLog)
+import Hsm.Repl (repl, runRepl)
+
+main :: IO ()
+main =
+ void (whileJust_ repl return)
+ & runRepl @"exec-repl λ " @'["Prelude"] @[Bool]
+ & runLog @"repl" Trace
+ & runResource
+ & runEff