From aa9f411f50bcccd351fd85422f59bbd023d7e9cf Mon Sep 17 00:00:00 2001 From: rhiannon morris Date: Wed, 30 Mar 2022 03:15:13 +0200 Subject: [PATCH] make YAML module less misleading --- blog-meta/lib/YAML.hs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/blog-meta/lib/YAML.hs b/blog-meta/lib/YAML.hs index 5f82298..3cec3dc 100644 --- a/blog-meta/lib/YAML.hs +++ b/blog-meta/lib/YAML.hs @@ -1,7 +1,7 @@ -module YAML (module YAML) where +module YAML (module YAML, module Data.YAML, untagged) where -import Data.YAML as YAML -import Data.YAML.Event as YAML (untagged) +import Data.YAML +import Data.YAML.Event (untagged) import Data.Text (Text) import qualified Data.Text as Text import Misc @@ -32,13 +32,13 @@ list = Sequence () untagged . map toYAML -- | read a chunk from the beginning of the file between a -- @---@ and a @...@. throw an exception if there isn't one -readHeader :: FilePath -> IO (YAML.Node YAML.Pos) +readHeader :: FilePath -> IO (Node Pos) readHeader file = IO.withFile file IO.ReadMode \h -> do ln <- BS.hGetLine h if (ln /= "---") then fail $ file <> ": no header" else - unwrap file . YAML.decode1 =<< linesUntil "..." h + unwrap file . decode1 =<< linesUntil "..." h -- | read all the lines from a handle until the given terminator. return the -- lines read, excluding the terminator