| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Text.Libyaml
Description
Low-level, streaming YAML interface. For a higher-level interface, see Data.Yaml.
- data MarkedEvent = MarkedEvent {}
- data Event
- data Style
- = Any
- | Plain
- | SingleQuoted
- | DoubleQuoted
- | Literal
- | Folded
- | PlainNoTag
- data SequenceStyle
- data MappingStyle
- data Tag
- type AnchorName = String
- type Anchor = Maybe AnchorName
- encode :: MonadResource m => ConduitM Event o m ByteString
- encodeWith :: MonadResource m => FormatOptions -> ConduitM Event o m ByteString
- decode :: MonadResource m => ByteString -> ConduitM i Event m ()
- decodeMarked :: MonadResource m => ByteString -> ConduitM i MarkedEvent m ()
- encodeFile :: MonadResource m => FilePath -> ConduitM Event o m ()
- decodeFile :: MonadResource m => FilePath -> ConduitM i Event m ()
- decodeFileMarked :: MonadResource m => FilePath -> ConduitM i MarkedEvent m ()
- encodeFileWith :: MonadResource m => FormatOptions -> FilePath -> ConduitM Event o m ()
- data FormatOptions
- defaultFormatOptions :: FormatOptions
- setWidth :: Maybe Int -> FormatOptions -> FormatOptions
- data YamlException
- data YamlMark = YamlMark {}
The event stream
data MarkedEvent #
Event with start and end marks.
Since: 0.10.4.0
Constructors
| MarkedEvent | |
Fields
| |
Style for scalars - e.g. quoted / folded
Constructors
| Any | |
| Plain | |
| SingleQuoted | |
| DoubleQuoted | |
| Literal | |
| Folded | |
| PlainNoTag |
data SequenceStyle #
Style for sequences - e.g. block or flow
Since: 0.9.0
Constructors
| AnySequence | |
| BlockSequence | |
| FlowSequence |
Instances
data MappingStyle #
Style for mappings - e.g. block or flow
Since: 0.9.0
Constructors
| AnyMapping | |
| BlockMapping | |
| FlowMapping |
Instances
type AnchorName = String #
type Anchor = Maybe AnchorName #
Encoding and decoding
encode :: MonadResource m => ConduitM Event o m ByteString #
encodeWith :: MonadResource m => FormatOptions -> ConduitM Event o m ByteString #
Since: 0.10.2.0
decode :: MonadResource m => ByteString -> ConduitM i Event m () #
Create a conduit that yields events from a bytestring.
decodeMarked :: MonadResource m => ByteString -> ConduitM i MarkedEvent m () #
Create a conduit that yields marked events from a bytestring.
This conduit will yield identical events to that of "decode", but also includes start and end marks for each event.
Since: 0.10.4.0
encodeFile :: MonadResource m => FilePath -> ConduitM Event o m () #
decodeFile :: MonadResource m => FilePath -> ConduitM i Event m () #
Creata a conduit that yields events from a file.
decodeFileMarked :: MonadResource m => FilePath -> ConduitM i MarkedEvent m () #
Create a conduit that yields marked events from a file.
This conduit will yield identical events to that of "decodeFile", but also includes start and end marks for each event.
Since: 0.10.4.0
encodeFileWith :: MonadResource m => FormatOptions -> FilePath -> ConduitM Event o m () #
Since: 0.10.2.0
data FormatOptions #
Contains options relating to the formatting (indendation, width) of the YAML output.
Since: 0.10.2.0
defaultFormatOptions :: FormatOptions #
Since: 0.10.2.0
setWidth :: Maybe Int -> FormatOptions -> FormatOptions #
Set the maximum number of columns in the YAML output, or Nothing for infinite. By default, the limit is 80 characters.
Since: 0.10.2.0
Error handling
data YamlException #
Constructors
| YamlException String | |
| YamlParseException | problem, context, index, position line, position column |
Fields | |
Instances