Copyright | (C) Frank Staals |
---|---|
License | see the LICENSE file |
Maintainer | Frank Staals |
Safe Haskell | None |
Language | Haskell2010 |
Description : Helper functions for working with yaml
Synopsis
- encodeYaml :: ToJSON a => a -> ByteString
- encodeYamlFile :: ToJSON a => FilePath -> a -> IO ()
- decodeYaml :: FromJSON a => ByteString -> Either ParseException a
- decodeYamlFile :: FromJSON a => FilePath -> IO (Either ParseException a)
- printYaml :: ToJSON a => a -> IO ()
- parseVersioned :: [(Version -> Bool, Value -> Parser a)] -> Value -> Parser (Versioned a)
- data Versioned a = Versioned Version a
- unversioned :: Versioned a -> a
Documentation
encodeYaml :: ToJSON a => a -> ByteString Source #
Write the output to yaml
decodeYaml :: FromJSON a => ByteString -> Either ParseException a Source #
alias for decodeEither' from the Yaml Package
decodeYamlFile :: FromJSON a => FilePath -> IO (Either ParseException a) Source #
alias for reading a yaml file
parseVersioned :: [(Version -> Bool, Value -> Parser a)] -> Value -> Parser (Versioned a) Source #
Given a list of candidate parsers, select the right one
Data type for things that have a version
Instances
unversioned :: Versioned a -> a Source #