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

Safe Haskell | None
Language | Haskell2010

Data.Yaml.Builder

Description

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

Synopsis

- newtype YamlBuilder = YamlBuilder {
  - unYamlBuilder :: [Event] -> [Event]
  }
- class ToYaml a where
  - toYaml :: a -> YamlBuilder
- mapping :: [(Text, YamlBuilder)] -> YamlBuilder
- namedMapping :: Text -> [(Text, YamlBuilder)] -> YamlBuilder
- maybeNamedMapping :: Maybe Text -> [(Text, YamlBuilder)] -> YamlBuilder
- mappingComplex :: [(YamlBuilder, YamlBuilder)] -> YamlBuilder
- namedMappingComplex :: Text -> [(YamlBuilder, YamlBuilder)] -> YamlBuilder
- maybeNamedMappingComplex :: Maybe Text -> [(YamlBuilder, YamlBuilder)] -> YamlBuilder
- array :: [YamlBuilder] -> YamlBuilder
- namedArray :: Text -> [YamlBuilder] -> YamlBuilder
- maybeNamedArray :: Maybe Text -> [YamlBuilder] -> YamlBuilder
- string :: Text -> YamlBuilder
- namedString :: Text -> Text -> YamlBuilder
- maybeNamedString :: Maybe Text -> Text -> YamlBuilder
- bool :: Bool -> YamlBuilder
- namedBool :: Text -> Bool -> YamlBuilder
- maybeNamedBool :: Maybe Text -> Bool -> YamlBuilder
- null :: YamlBuilder
- namedNull :: Text -> YamlBuilder
- maybeNamedNull :: Maybe Text -> YamlBuilder
- scientific :: Scientific -> YamlBuilder
- namedScientific :: Text -> Scientific -> YamlBuilder
- maybeNamedScientific :: Maybe Text -> Scientific -> YamlBuilder
- alias :: Text -> YamlBuilder
- number :: Scientific -> YamlBuilder
- toByteString :: ToYaml a => a -> ByteString
- toByteStringWith :: ToYaml a => FormatOptions -> a -> ByteString
- writeYamlFile :: ToYaml a => FilePath -> a -> IO ()
- writeYamlFileWith :: ToYaml a => FormatOptions -> FilePath -> a -> IO ()
- (.=) :: ToYaml a => Text -> a -> (Text, YamlBuilder)
- data FormatOptions
- setWidth :: Maybe Int -> FormatOptions -> FormatOptions

# Documentation

newtype YamlBuilder Source #

Constructors

YamlBuilder |

Fields

- unYamlBuilder :: [Event] -> [Event]

#### Instances

Instances details

ToYaml YamlBuilder Source # |
Instance details Defined in Data.Yaml.Builder Methods toYaml :: YamlBuilder -> YamlBuilder Source #

class ToYaml a where Source #

Methods

toYaml :: a -> YamlBuilder Source #

#### Instances

Instances details

ToYaml Scientific Source # |
Instance details Defined in Data.Yaml.Builder Methods toYaml :: Scientific -> YamlBuilder Source #
ToYaml Text Source # |
Instance details Defined in Data.Yaml.Builder Methods toYaml :: Text -> YamlBuilder Source #
ToYaml YamlBuilder Source # |
Instance details Defined in Data.Yaml.Builder Methods toYaml :: YamlBuilder -> YamlBuilder Source #
ToYaml String Source # |
Instance details Defined in Data.Yaml.Builder Methods toYaml :: String -> YamlBuilder Source #
ToYaml Bool Source # |
Instance details Defined in Data.Yaml.Builder Methods toYaml :: Bool -> YamlBuilder Source #
ToYaml Double Source # |
Instance details Defined in Data.Yaml.Builder Methods toYaml :: Double -> YamlBuilder Source #
ToYaml Int Source # |
Instance details Defined in Data.Yaml.Builder Methods toYaml :: Int -> YamlBuilder Source #
ToYaml a => ToYaml (Maybe a) Source # |
Instance details Defined in Data.Yaml.Builder Methods toYaml :: Maybe a -> YamlBuilder Source #
(ToYaml a, ToYaml b) => ToYaml [(a, b)] Source # |
Instance details Defined in Data.Yaml.Builder Methods toYaml :: [(a, b)] -> YamlBuilder Source #
ToYaml a => ToYaml [a] Source # |
Instance details Defined in Data.Yaml.Builder Methods toYaml :: [a] -> YamlBuilder Source #

mapping :: [(Text, YamlBuilder)] -> YamlBuilder Source #

Since: 0.8.7

namedMapping :: Text -> [(Text, YamlBuilder)] -> YamlBuilder Source #

Since: 0.10.3.0

maybeNamedMapping :: Maybe Text -> [(Text, YamlBuilder)] -> YamlBuilder Source #

Since: 0.10.3.0

mappingComplex :: [(YamlBuilder, YamlBuilder)] -> YamlBuilder Source #

Since: 0.11.2.0

namedMappingComplex :: Text -> [(YamlBuilder, YamlBuilder)] -> YamlBuilder Source #

Since: 0.11.2.0

maybeNamedMappingComplex :: Maybe Text -> [(YamlBuilder, YamlBuilder)] -> YamlBuilder Source #

Since: 0.11.2.0

array :: [YamlBuilder] -> YamlBuilder Source #

Since: 0.8.7

namedArray :: Text -> [YamlBuilder] -> YamlBuilder Source #

Since: 0.10.3.0

maybeNamedArray :: Maybe Text -> [YamlBuilder] -> YamlBuilder Source #

Since: 0.10.3.0

string :: Text -> YamlBuilder Source #

Since: 0.8.7

namedString :: Text -> Text -> YamlBuilder Source #

Since: 0.10.3.0

maybeNamedString :: Maybe Text -> Text -> YamlBuilder Source #

Since: 0.10.3.0

bool :: Bool -> YamlBuilder Source #

Since: 0.8.13

namedBool :: Text -> Bool -> YamlBuilder Source #

Since: 0.10.3.0

maybeNamedBool :: Maybe Text -> Bool -> YamlBuilder Source #

Since: 0.10.3.0

null :: YamlBuilder Source #

Since: 0.8.13

namedNull :: Text -> YamlBuilder Source #

Since: 0.10.3.0

maybeNamedNull :: Maybe Text -> YamlBuilder Source #

Since: 0.10.3.0

scientific :: Scientific -> YamlBuilder Source #

Since: 0.8.13

namedScientific :: Text -> Scientific -> YamlBuilder Source #

Since: 0.10.3.0

maybeNamedScientific :: Maybe Text -> Scientific -> YamlBuilder Source #

Since: 0.10.3.0

alias :: Text -> YamlBuilder Source #

Since: 0.10.3.0

number :: Scientific -> YamlBuilder Source #

Deprecated: Use scientific

Since: 0.8.13

toByteString :: ToYaml a => a -> ByteString Source #

Since: 0.8.7

toByteStringWith :: ToYaml a => FormatOptions -> a -> ByteString Source #

Since: 0.10.2.0

writeYamlFile :: ToYaml a => FilePath -> a -> IO () Source #

writeYamlFileWith :: ToYaml a => FormatOptions -> FilePath -> a -> IO () Source #

Since: 0.10.2.0

(.=) :: ToYaml a => Text -> a -> (Text, YamlBuilder) Source #

data FormatOptions Source #

Contains options relating to the formatting (indendation, width) of the YAML output.

Since: libyaml-0.10.2.0

setWidth :: Maybe Int -> FormatOptions -> FormatOptions Source #

Set the maximum number of columns in the YAML output, or `Nothing` for infinite. By default, the limit is 80 characters.

Since: libyaml-0.10.2.0