mathiassm
Safe HaskellNone
LanguageGHC2024

MathiasSM.Yaml

Description

Shared helpers for decoding the site's YAML documents into typed values

Synopsis

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

newtype Check a Source #

Like Either, but combining failures instead of stopping at the first

Constructors

Check 

Fields

Instances

Instances details
Applicative Check Source # 
Instance details

Defined in MathiasSM.Yaml

Methods

pure :: a -> Check a #

(<*>) :: Check (a -> b) -> Check a -> Check b #

liftA2 :: (a -> b -> c) -> Check a -> Check b -> Check c #

(*>) :: Check a -> Check b -> Check b #

(<*) :: Check a -> Check b -> Check a #

Functor Check Source # 
Instance details

Defined in MathiasSM.Yaml

Methods

fmap :: (a -> b) -> Check a -> Check b #

(<$) :: a -> Check b -> Check a #

enumFromJSON :: (Enum a, Bounded a) => String -> (a -> String) -> Value -> Parser a Source #

Accepts exactly the spellings render produces