From bca59ef2624ca1d9c1874db6d6f8e9270db0dfb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Fri, 7 Oct 2022 14:37:58 +0200 Subject: Number type for arbitrary-precision floating point values --- src/Test.hs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/Test.hs') 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" -- cgit v1.2.3