summaryrefslogtreecommitdiff
path: root/src/Data/Yaml
diff options
context:
space:
mode:
authorJasper Van der Jeugt <m@jaspervdj.be>2017-06-19 11:57:23 +0200
committerJasper Van der Jeugt <m@jaspervdj.be>2017-06-19 11:57:23 +0200
commit67ecff7ad383640bc73d64edc2506c7cc648a134 (patch)
tree6d328e43c3ab86c29a2d775fabaa23618c16fb51 /src/Data/Yaml
parent2df3209bafa08e6b77ee4a8598fc503269513527 (diff)
downloadhakyll-67ecff7ad383640bc73d64edc2506c7cc648a134.tar.gz
Move src/ to lib/, put Init.hs in src/
Diffstat (limited to 'src/Data/Yaml')
-rw-r--r--src/Data/Yaml/Extended.hs24
1 files changed, 0 insertions, 24 deletions
diff --git a/src/Data/Yaml/Extended.hs b/src/Data/Yaml/Extended.hs
deleted file mode 100644
index c940ff7..0000000
--- a/src/Data/Yaml/Extended.hs
+++ /dev/null
@@ -1,24 +0,0 @@
-module Data.Yaml.Extended
- ( module Data.Yaml
- , toString
- , toList
- ) where
-
-import qualified Data.Text as T
-import qualified Data.Vector as V
-import Data.Yaml
-import Data.Scientific
-
-toString :: Value -> Maybe String
-toString (String t) = Just (T.unpack t)
-toString (Bool True) = Just "true"
-toString (Bool False) = Just "false"
--- | Make sure that numeric fields containing integer numbers are shown as
--- | integers (i.e., "42" instead of "42.0").
-toString (Number d) | isInteger d = Just (formatScientific Fixed (Just 0) d)
- | otherwise = Just (show d)
-toString _ = Nothing
-
-toList :: Value -> Maybe [Value]
-toList (Array a) = Just (V.toList a)
-toList _ = Nothing