yaml-0.2.0: Low-level binding to the libyaml C library.Source codeContentsIndex
Text.Libyaml
Contents
The event stream
Exceptions
Enumerator
Encoder
Higher level functions
Synopsis
data Event
= EventNone
| EventStreamStart
| EventStreamEnd
| EventDocumentStart
| EventDocumentEnd
| EventAlias
| EventScalar !ByteString !Tag !Style
| EventSequenceStart
| EventSequenceEnd
| EventMappingStart
| EventMappingEnd
data Style
= Any
| Plain
| SingleQuoted
| DoubleQuoted
| Literal
| Folded
data Tag
= StrTag
| FloatTag
| NullTag
| BoolTag
| SetTag
| IntTag
| SeqTag
| MapTag
| UriTag String
| NoTag
data YamlException
= YamlParserException {
parserProblem :: String
parserContext :: String
parserOffset :: Int
}
| YamlEmitterException {
emitterEvent :: Event
emitterProblem :: String
}
| YamlOutOfMemory
| YamlInvalidEventStreamBeginning [Event]
| YamlInvalidEventStreamEnd [Event]
| YamlPrematureEventStreamEnd
| YamlNonScalarKey
| YamlInvalidStartingEvent Event
| YamlFileNotFound FilePath
| YamlOtherException SomeException
| YamlStringException String
class MonadIO m => With m where
with :: (forall b'. (a -> IO b') -> IO b') -> (a -> m b) -> m b
type YamlEncoder = ReaderT Emitter
type YamlDecoder = ReaderT Parser
parseEvent :: (With m, MonadFailure YamlException m) => YamlDecoder m Event
emitEvent :: (MonadIO m, MonadFailure YamlException m) => Event -> YamlEncoder m ()
encode :: (With m, MonadFailure YamlException m) => YamlEncoder m () -> m ByteString
decode :: (With m, MonadFailure YamlException m) => ByteString -> YamlDecoder m a -> m a
encodeFile :: (With m, MonadFailure YamlException m) => FilePath -> YamlEncoder m () -> m ()
decodeFile :: (With m, MonadFailure YamlException m) => FilePath -> YamlDecoder m a -> m a
The event stream
data Event Source
Constructors
EventNone
EventStreamStart
EventStreamEnd
EventDocumentStart
EventDocumentEnd
EventAlias
EventScalar !ByteString !Tag !Style
EventSequenceStart
EventSequenceEnd
EventMappingStart
EventMappingEnd
show/hide Instances
data Style Source
Constructors
Any
Plain
SingleQuoted
DoubleQuoted
Literal
Folded
show/hide Instances
data Tag Source
Constructors
StrTag
FloatTag
NullTag
BoolTag
SetTag
IntTag
SeqTag
MapTag
UriTag String
NoTag
show/hide Instances
Exceptions
data YamlException Source
Constructors
YamlParserException
parserProblem :: String
parserContext :: String
parserOffset :: Int
YamlEmitterException
emitterEvent :: Event
emitterProblem :: String
YamlOutOfMemory
YamlInvalidEventStreamBeginning [Event]
YamlInvalidEventStreamEnd [Event]
YamlPrematureEventStreamEnd
YamlNonScalarKey
YamlInvalidStartingEvent Event
YamlFileNotFound FilePath
YamlOtherException SomeException
YamlStringException String
show/hide Instances
Enumerator
class MonadIO m => With m whereSource
Methods
with :: (forall b'. (a -> IO b') -> IO b') -> (a -> m b) -> m bSource
show/hide Instances
With IO
With m => With (ReaderT r m)
(Error e, With m) => With (ErrorT e m)
Encoder
type YamlEncoder = ReaderT EmitterSource
type YamlDecoder = ReaderT ParserSource
parseEvent :: (With m, MonadFailure YamlException m) => YamlDecoder m EventSource
emitEvent :: (MonadIO m, MonadFailure YamlException m) => Event -> YamlEncoder m ()Source
Higher level functions
encode :: (With m, MonadFailure YamlException m) => YamlEncoder m () -> m ByteStringSource
decode :: (With m, MonadFailure YamlException m) => ByteString -> YamlDecoder m a -> m aSource
encodeFile :: (With m, MonadFailure YamlException m) => FilePath -> YamlEncoder m () -> m ()Source
decodeFile :: (With m, MonadFailure YamlException m) => FilePath -> YamlDecoder m a -> m aSource
Produced by Haddock version 2.6.1