yaml-0.8.22: 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
- 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 # |
Methods toYaml :: YamlBuilder -> YamlBuilder #

class ToYaml a where #

Minimal complete definition

toYaml

Methods

toYaml :: a -> YamlBuilder #

Instances

ToYaml Int # |
Methods toYaml :: Int -> YamlBuilder #
ToYaml Text # |
Methods toYaml :: Text -> YamlBuilder #
ToYaml YamlBuilder # |
Methods toYaml :: YamlBuilder -> YamlBuilder #
ToYaml a => ToYaml [(Text, a)] # |
Methods toYaml :: [(Text, a)] -> YamlBuilder #
ToYaml a => ToYaml [a] # |
Methods toYaml :: [a] -> YamlBuilder #

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) #