From afbc784dc0733bc5d0ff243e2ae9b9e5a8613f69 Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Wed, 6 Apr 2016 17:55:37 +0200 Subject: Add functionField external tutorial --- src/Data/Yaml/Extended.hs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/Data/Yaml/Extended.hs b/src/Data/Yaml/Extended.hs index 9ad05f3..099e945 100644 --- a/src/Data/Yaml/Extended.hs +++ b/src/Data/Yaml/Extended.hs @@ -9,8 +9,11 @@ import qualified Data.Vector as V import Data.Yaml toString :: Value -> Maybe String -toString (String t) = Just (T.unpack t) -toString _ = Nothing +toString (String t) = Just (T.unpack t) +toString (Bool True) = Just "true" +toString (Bool False) = Just "false" +toString (Number d) = Just (show d) +toString _ = Nothing toList :: Value -> Maybe [Value] toList (Array a) = Just (V.toList a) -- cgit v1.2.3