From 57516242357cba015cc5e99e28d7f5e87dc5d7e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Sat, 30 Nov 2024 19:31:49 +0100 Subject: Trace regex variables in expect using new type --- src/Parser/Statement.hs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/Parser') diff --git a/src/Parser/Statement.hs b/src/Parser/Statement.hs index 21b24a6..a65227d 100644 --- a/src/Parser/Statement.hs +++ b/src/Parser/Statement.hs @@ -153,6 +153,12 @@ instance (ParamType a, ParamType b) => ParamType (Either a b) where paramFromSomeExpr _ se = (Left <$> paramFromSomeExpr @a Proxy se) <|> (Right <$> paramFromSomeExpr @b Proxy se) paramExpr = either (fmap Left . paramExpr) (fmap Right . paramExpr) +instance ExprType a => ParamType (Traced a) where + type ParamRep (Traced a) = Expr a + parseParam _ = parseParam (Proxy @(Expr a)) + showParamType _ = showParamType (Proxy @(Expr a)) + paramExpr = Trace + data SomeParam f = forall a. ParamType a => SomeParam (Proxy a) (f (ParamRep a)) data CommandDef a = CommandDef [(String, SomeParam Proxy)] ([SomeParam Identity] -> Expr a) -- cgit v1.2.3