aboutsummaryrefslogtreecommitdiffstats
path: root/src/MyLib.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/MyLib.hs')
-rw-r--r--src/MyLib.hs8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/MyLib.hs b/src/MyLib.hs
index 864f99e..c8dc95d 100644
--- a/src/MyLib.hs
+++ b/src/MyLib.hs
@@ -31,13 +31,7 @@ instance CoerceTo Bool where
coerceTo (IntVal v) = Just $ v /= 0
coerceTo (StrVal "True") = Just True
coerceTo (StrVal "true") = Just True
- --coerceTo v@(StrVal _) = coerceTo . IntVal =<< (coerceTo v :: Maybe Integer) :: Maybe Bool
- coerceTo v@(StrVal x) = case (readMaybe x :: Maybe Integer) of
- Nothing -> Just False
- Just n -> Just $ True--n /= 0
--- case coerceTo v :: Maybe Integer of
--- Nothing -> Just False
--- Just n -> coerceTo (IntVal n)
+ coerceTo v = coerceTo . IntVal =<< (coerceTo v :: Maybe Integer) :: Maybe Bool
coerceFrom = BoolVal