From 202fd8ba096ff5a80102cbec2922eef94061458b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Sun, 5 Jun 2022 20:58:47 +0200 Subject: Refactor expressions as GADT --- src/Main.hs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/Main.hs') 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 -- cgit v1.2.3