summaryrefslogtreecommitdiff
path: root/src/Test.hs
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2022-10-07 14:37:58 +0200
committerRoman Smrž <roman.smrz@seznam.cz>2022-10-07 18:28:22 +0200
commitbca59ef2624ca1d9c1874db6d6f8e9270db0dfb7 (patch)
treeccd4adc5ac31d10d745d6e551b3748f6fe188483 /src/Test.hs
parent409e9dc95aa9f17770f21d11a65ec839da699f16 (diff)
Number type for arbitrary-precision floating point values
Diffstat (limited to 'src/Test.hs')
-rw-r--r--src/Test.hs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Test.hs b/src/Test.hs
index cfc144b..ab7e125 100644
--- a/src/Test.hs
+++ b/src/Test.hs
@@ -15,6 +15,7 @@ module Test (
import Data.Char
import Data.List
+import Data.Scientific
import Data.Text (Text)
import qualified Data.Text as T
import Data.Typeable
@@ -71,6 +72,11 @@ instance ExprType Integer where
textExprValue x = T.pack (show x)
emptyVarValue = 0
+instance ExprType Scientific where
+ textExprType _ = T.pack "number"
+ textExprValue x = T.pack (show x)
+ emptyVarValue = 0
+
instance ExprType Bool where
textExprType _ = T.pack "bool"
textExprValue True = T.pack "true"