From 57c27f313e9f28548aec19e58b1497b79d7d5335 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Sun, 28 Sep 2025 20:38:18 +0200 Subject: Additional instances of ExprType used by parsed commands --- src/Script/Var.hs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/Script/Var.hs') diff --git a/src/Script/Var.hs b/src/Script/Var.hs index 668060c..2c50101 100644 --- a/src/Script/Var.hs +++ b/src/Script/Var.hs @@ -9,6 +9,8 @@ module Script.Var ( import Data.Text (Text) import Data.Text qualified as T +import Script.Expr.Class + newtype VarName = VarName Text deriving (Eq, Ord) @@ -40,6 +42,10 @@ unqualifyName (LocalVarName name) = name newtype TypedVarName a = TypedVarName { fromTypedVarName :: VarName } deriving (Eq, Ord) +instance ExprType a => ExprType (TypedVarName a) where + textExprType _ = "TypedVarName" + textExprValue = textVarName . fromTypedVarName + newtype ModuleName = ModuleName [ Text ] deriving (Eq, Ord, Show) @@ -54,3 +60,7 @@ data SourceLine textSourceLine :: SourceLine -> Text textSourceLine (SourceLine text) = text textSourceLine SourceLineBuiltin = "" + +instance ExprType SourceLine where + textExprType _ = "SourceLine" + textExprValue = textSourceLine -- cgit v1.2.3