diff options
| author | Roman Smrž <roman.smrz@seznam.cz> | 2026-08-27 20:34:57 +0200 |
|---|---|---|
| committer | Roman Smrž <roman.smrz@seznam.cz> | 2026-08-27 23:04:38 +0200 |
| commit | 0cbbe31c5f16df73dcc3a73b37cac4a72948f3a6 (patch) | |
| tree | f607a68d575ac670b9a637a967eabbe56f9257aa /src/Script/Expr.hs | |
| parent | d8420a37ffe9e752816b071fced4a972ca1fad23 (diff) | |
Accept various builtin types in type expressions
Diffstat (limited to 'src/Script/Expr.hs')
| -rw-r--r-- | src/Script/Expr.hs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Script/Expr.hs b/src/Script/Expr.hs index 09b7c80..e6f945d 100644 --- a/src/Script/Expr.hs +++ b/src/Script/Expr.hs @@ -8,6 +8,7 @@ module Script.Expr ( FunctionType, DynamicType, ExprType(..), SomeExpr(..), + SomePrimType(..), TypeVar(..), SomeExprType(..), someExprType, textSomeExprType, renameTypeVar, renameVarInType, @@ -293,6 +294,8 @@ instance ExprType DynamicType where data SomeExpr = forall a. ExprType a => SomeExpr (Expr a) +data SomePrimType = forall a. ExprType a => SomePrimType (Proxy a) + newtype TypeVar = TypeVar Text deriving (Eq, Ord) @@ -569,7 +572,7 @@ data Regex = RegexCompiled Text RE.Regex | RegexString Text instance ExprType Regex where - textExprType _ = T.pack "regex" + textExprType _ = T.pack "Regex" textExprValue _ = T.pack "<regex>" exprExpansionConvFrom = listToMaybe $ catMaybes |