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 #

Constructors

YamlBuilder |
Fields unYamlBuilder :: [Event] -> [Event]

#### Instances

Instances details

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

class ToYaml a where #

Methods

toYaml :: a -> YamlBuilder #

#### Instances

Instances details

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

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

Since: 0.8.7

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

Since: 0.10.3.0

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

Since: 0.10.3.0

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

Since: 0.11.2.0

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

Since: 0.11.2.0

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

Since: 0.11.2.0

array :: [YamlBuilder] -> YamlBuilder #

Since: 0.8.7

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

Since: 0.10.3.0

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

Since: 0.10.3.0

string :: Text -> YamlBuilder #

Since: 0.8.7

namedString :: Text -> Text -> YamlBuilder #

Since: 0.10.3.0

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

Since: 0.10.3.0

bool :: Bool -> YamlBuilder #

Since: 0.8.13

namedBool :: Text -> Bool -> YamlBuilder #

Since: 0.10.3.0

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

Since: 0.10.3.0

null :: YamlBuilder #

Since: 0.8.13

namedNull :: Text -> YamlBuilder #

Since: 0.10.3.0

maybeNamedNull :: Maybe Text -> YamlBuilder #

Since: 0.10.3.0

scientific :: Scientific -> YamlBuilder #

Since: 0.8.13

namedScientific :: Text -> Scientific -> YamlBuilder #

Since: 0.10.3.0

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

Since: 0.10.3.0

alias :: Text -> YamlBuilder #

Since: 0.10.3.0

number :: Scientific -> YamlBuilder #

Deprecated: Use scientific

Since: 0.8.13

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

Since: 0.8.7

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

Since: 0.10.2.0

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

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

Since: 0.10.2.0

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

data FormatOptions #

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

Since: libyaml-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: libyaml-0.10.2.0