Data.Yaml.Builder

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

Safe Haskell | None
Language | Haskell98

Data.Yaml.Builder

Description

NOTE: This module is a highly experimental preview release. It may change 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
- array :: [YamlBuilder] -> YamlBuilder
- string :: Text -> YamlBuilder
- bool :: Bool -> YamlBuilder
- null :: YamlBuilder
- scientific :: Scientific -> YamlBuilder
- number :: Scientific -> YamlBuilder
- toByteString :: ToYaml a => a -> ByteString
- writeYamlFile :: ToYaml a => FilePath -> a -> IO ()
- (.=) :: ToYaml a => Text -> a -> (Text, YamlBuilder)

# Documentation

newtype YamlBuilder

Constructors

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

Instances

ToYaml YamlBuilder |

class ToYaml a where

Methods

toYaml :: a -> YamlBuilder

Instances

ToYaml Int |
ToYaml Text |
ToYaml YamlBuilder |
ToYaml a => ToYaml [(Text, a)] |
ToYaml a => ToYaml [a] |

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

array :: [YamlBuilder] -> YamlBuilder

string :: Text -> YamlBuilder

bool :: Bool -> YamlBuilder

null :: YamlBuilder

scientific :: Scientific -> YamlBuilder

number :: Scientific -> YamlBuilder

Deprecated: Use scientific

toByteString :: ToYaml a => a -> ByteString

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

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