| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
MathiasSM.Yaml
Description
Shared helpers for decoding the site's YAML documents into typed values
Synopsis
- decodeYaml :: FromJSON a => String -> Either [String] a
- parseYamlList :: String -> (Object -> Either [String] a) -> String -> Either [String] [a]
- newtype Check a = Check {}
- required :: FromJSON a => Object -> Key -> Check a
- optional :: FromJSON a => Object -> Key -> Check (Maybe a)
- enumFromJSON :: (Enum a, Bounded a) => String -> (a -> String) -> Value -> Parser a
Documentation
decodeYaml :: FromJSON a => String -> Either [String] a Source #
Decodes a YAML document, reporting the parse problems found
parseYamlList :: String -> (Object -> Either [String] a) -> String -> Either [String] [a] Source #
Decodes a top-level YAML list of objects, parsing each one and prefixing its problems by index