summaryrefslogtreecommitdiff
path: root/src/Main.hs
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2022-06-05 20:58:47 +0200
committerRoman Smrž <roman.smrz@seznam.cz>2022-06-05 20:58:47 +0200
commit202fd8ba096ff5a80102cbec2922eef94061458b (patch)
tree5546acec206cffa4201c6e1d75634ece0347e32f /src/Main.hs
parent7f9decf5ec9e4d9fbdfad23d7ce438c95bd8a862 (diff)
Refactor expressions as GADT
Diffstat (limited to 'src/Main.hs')
-rw-r--r--src/Main.hs9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/Main.hs b/src/Main.hs
index a1b6625..e062dee 100644
--- a/src/Main.hs
+++ b/src/Main.hs
@@ -1,6 +1,5 @@
module Main where
-import Control.Arrow
import Control.Applicative
import Control.Concurrent
import Control.Concurrent.STM
@@ -333,13 +332,13 @@ runTest out opts test = do
Send pname expr -> do
p <- getProcess net pname
- line <- evalStringExpr expr
+ line <- eval expr
send p line
- Expect pname expr@(RegexExpr ps) captures -> do
+ Expect pname expr@(Regex ps) captures -> do
p <- getProcess net pname
- regex <- evalRegexExpr expr
- pat <- evalStringExpr (StringExpr $ map (left T.pack) ps)
+ regex <- eval expr
+ pat <- eval (Concat ps)
expect p regex pat captures
Wait -> do