From 4603b8e9b1d2b99b8286c82d55ac18ba00fe7331 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Sun, 5 Feb 2023 20:46:04 +0100 Subject: List expression type --- src/Test.hs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/Test.hs') diff --git a/src/Test.hs b/src/Test.hs index b2644b6..b6a85ae 100644 --- a/src/Test.hs +++ b/src/Test.hs @@ -96,6 +96,11 @@ instance ExprType Regex where textExprValue _ = T.pack "" emptyVarValue = either error id $ regexCompile T.empty +instance ExprType a => ExprType [a] where + textExprType _ = "[" <> textExprType @a Proxy <> "]" + textExprValue x = "[" <> T.intercalate ", " (map textExprValue x) <> "]" + emptyVarValue = [] + data SomeVarValue = forall a. ExprType a => SomeVarValue a data RecordSelector a = forall b. ExprType b => RecordSelector (a -> b) -- cgit v1.2.3