yaml-0.11.11.2: Support for parsing and rendering YAML documents.

Safe Haskell | None
Language | Haskell2010

Data.Yaml.Parser

Description

drastically, or be entirely removed, in a future release.

# Documentation

newtype YamlParser a Source #

Constructors

YamlParser |

Fields

- unYamlParser :: AnchorMap -> Either Text a

#### Instances

Instances details

Alternative YamlParser Source # |
Instance details Defined in Data.Yaml.Parser Methods empty :: YamlParser a Source # (<|>) :: YamlParser a -> YamlParser a -> YamlParser a Source # some :: YamlParser a -> YamlParser [a] Source # many :: YamlParser a -> YamlParser [a] Source #
Applicative YamlParser Source # |
Instance details Defined in Data.Yaml.Parser Methods pure :: a -> YamlParser a Source # (<*>) :: YamlParser (a -> b) -> YamlParser a -> YamlParser b Source # liftA2 :: (a -> b -> c) -> YamlParser a -> YamlParser b -> YamlParser c Source # (*>) :: YamlParser a -> YamlParser b -> YamlParser b Source # (<*) :: YamlParser a -> YamlParser b -> YamlParser a Source #
Functor YamlParser Source # |
Instance details Defined in Data.Yaml.Parser Methods fmap :: (a -> b) -> YamlParser a -> YamlParser b Source # (<$) :: a -> YamlParser b -> YamlParser a Source #
Monad YamlParser Source # |
Instance details Defined in Data.Yaml.Parser Methods (>>=) :: YamlParser a -> (a -> YamlParser b) -> YamlParser b Source # (>>) :: YamlParser a -> YamlParser b -> YamlParser b Source # return :: a -> YamlParser a Source #
MonadPlus YamlParser Source # |
Instance details Defined in Data.Yaml.Parser Methods mzero :: YamlParser a Source # mplus :: YamlParser a -> YamlParser a -> YamlParser a Source #
MonadFail YamlParser Source # |
Instance details Defined in Data.Yaml.Parser Methods fail :: String -> YamlParser a Source #
Monoid (YamlParser a) Source # |
Instance details Defined in Data.Yaml.Parser Methods mempty :: YamlParser a Source # mappend :: YamlParser a -> YamlParser a -> YamlParser a Source # mconcat :: [YamlParser a] -> YamlParser a Source #
Semigroup (YamlParser a) Source # |
Instance details Defined in Data.Yaml.Parser Methods (<>) :: YamlParser a -> YamlParser a -> YamlParser a Source # sconcat :: NonEmpty (YamlParser a) -> YamlParser a Source # stimes :: Integral b => b -> YamlParser a -> YamlParser a Source #

lookupAnchor :: AnchorName -> YamlParser (Maybe YamlValue) Source #

withAnchor :: AnchorName -> Text -> (YamlValue -> YamlParser a) -> YamlParser a Source #

withMapping :: Text -> ([(Text, YamlValue)] -> YamlParser a) -> YamlValue -> YamlParser a Source #

withSequence :: Text -> ([YamlValue] -> YamlParser a) -> YamlValue -> YamlParser a Source #

withText :: Text -> (Text -> YamlParser a) -> YamlValue -> YamlParser a Source #

typeMismatch :: Text -> YamlValue -> YamlParser a Source #

class FromYaml a where Source #

Methods

fromYaml :: YamlValue -> YamlParser a Source #

#### Instances

Instances details

FromYaml Text Source # |
Instance details Defined in Data.Yaml.Parser Methods fromYaml :: YamlValue -> YamlParser Text Source #
FromYaml YamlValue Source # |
Instance details Defined in Data.Yaml.Parser Methods fromYaml :: YamlValue -> YamlParser YamlValue Source #
FromYaml Int Source # |
Instance details Defined in Data.Yaml.Parser Methods fromYaml :: YamlValue -> YamlParser Int Source #
FromYaml a => FromYaml [a] Source # |
Instance details Defined in Data.Yaml.Parser Methods fromYaml :: YamlValue -> YamlParser [a] Source #

data YamlValue Source #

Constructors

Mapping [(Text, YamlValue)] Anchor |
Sequence [YamlValue] Anchor |
Scalar ByteString Tag Style Anchor |
Alias AnchorName |

#### Instances

Instances details

Show YamlValue Source # |
Instance details Defined in Data.Yaml.Parser Methods showsPrec :: Int -> YamlValue -> ShowS Source # show :: YamlValue -> String Source # showList :: [YamlValue] -> ShowS Source #
FromYaml YamlValue Source # |
Instance details Defined in Data.Yaml.Parser Methods fromYaml :: YamlValue -> YamlParser YamlValue Source #

type AnchorMap = Map AnchorName YamlValue Source #

data RawDoc Source #

Constructors

RawDoc YamlValue AnchorMap |

#### Instances

Instances details

Show RawDoc Source # |
Instance details Defined in Data.Yaml.Parser Methods showsPrec :: Int -> RawDoc -> ShowS Source # show :: RawDoc -> String Source # showList :: [RawDoc] -> ShowS Source #

parseRawDoc :: (FromYaml a, MonadThrow m) => RawDoc -> m a Source #

(.:) :: FromYaml a => [(Text, YamlValue)] -> Text -> YamlParser a Source #

data YamlParseException Source #

Constructors

UnexpectedEndOfEvents |
UnexpectedEvent Event |
FromYamlException Text |

#### Instances

Instances details

Exception YamlParseException Source # |
Instance details Defined in Data.Yaml.Parser Methods toException :: YamlParseException -> SomeException Source # fromException :: SomeException -> Maybe YamlParseException Source # displayException :: YamlParseException -> String Source # backtraceDesired :: YamlParseException -> Bool Source #
Show YamlParseException Source # |
Instance details Defined in Data.Yaml.Parser Methods showsPrec :: Int -> YamlParseException -> ShowS Source # show :: YamlParseException -> String Source # showList :: [YamlParseException] -> ShowS Source #

sinkValue :: forall (m :: Type -> Type) o. MonadThrow m => ConduitM Event o (WriterT AnchorMap m) YamlValue Source #

sinkRawDoc :: forall (m :: Type -> Type) o. MonadThrow m => ConduitM Event o m RawDoc Source #

readYamlFile :: FromYaml a => FilePath -> IO a Source #