hgeometry-0.8.0.0: Geometric Algorithms, Data structures, and Data types.

Copyright(C) Frank Staals
Licensesee the LICENSE file
MaintainerFrank Staals
Safe HaskellNone
LanguageHaskell2010

Data.Yaml.Util

Description

Description : Helper functions for working with yaml

Synopsis

Documentation

encodeYaml :: ToJSON a => a -> ByteString Source #

Write the output to yaml

encodeYamlFile :: ToJSON a => FilePath -> a -> IO () Source #

Encode a yaml file

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

printYaml :: ToJSON a => a -> IO () Source #

Prints the yaml

parseVersioned :: [(Version -> Bool, Value -> Parser a)] -> Value -> Parser (Versioned a) Source #

Given a list of candidate parsers, select the right one

data Versioned a Source #

Data type for things that have a version

Constructors

Versioned Version a 
Instances
Functor Versioned Source # 
Instance details

Defined in Data.Yaml.Util

Methods

fmap :: (a -> b) -> Versioned a -> Versioned b #

(<$) :: a -> Versioned b -> Versioned a #

Foldable Versioned Source # 
Instance details

Defined in Data.Yaml.Util

Methods

fold :: Monoid m => Versioned m -> m #

foldMap :: Monoid m => (a -> m) -> Versioned a -> m #

foldr :: (a -> b -> b) -> b -> Versioned a -> b #

foldr' :: (a -> b -> b) -> b -> Versioned a -> b #

foldl :: (b -> a -> b) -> b -> Versioned a -> b #

foldl' :: (b -> a -> b) -> b -> Versioned a -> b #

foldr1 :: (a -> a -> a) -> Versioned a -> a #

foldl1 :: (a -> a -> a) -> Versioned a -> a #

toList :: Versioned a -> [a] #

null :: Versioned a -> Bool #

length :: Versioned a -> Int #

elem :: Eq a => a -> Versioned a -> Bool #

maximum :: Ord a => Versioned a -> a #

minimum :: Ord a => Versioned a -> a #

sum :: Num a => Versioned a -> a #

product :: Num a => Versioned a -> a #

Traversable Versioned Source # 
Instance details

Defined in Data.Yaml.Util

Methods

traverse :: Applicative f => (a -> f b) -> Versioned a -> f (Versioned b) #

sequenceA :: Applicative f => Versioned (f a) -> f (Versioned a) #

mapM :: Monad m => (a -> m b) -> Versioned a -> m (Versioned b) #

sequence :: Monad m => Versioned (m a) -> m (Versioned a) #

Eq a => Eq (Versioned a) Source # 
Instance details

Defined in Data.Yaml.Util

Methods

(==) :: Versioned a -> Versioned a -> Bool #

(/=) :: Versioned a -> Versioned a -> Bool #

Read a => Read (Versioned a) Source # 
Instance details

Defined in Data.Yaml.Util

Show a => Show (Versioned a) Source # 
Instance details

Defined in Data.Yaml.Util

Generic (Versioned a) Source # 
Instance details

Defined in Data.Yaml.Util

Associated Types

type Rep (Versioned a) :: Type -> Type #

Methods

from :: Versioned a -> Rep (Versioned a) x #

to :: Rep (Versioned a) x -> Versioned a #

ToJSON a => ToJSON (Versioned a) Source # 
Instance details

Defined in Data.Yaml.Util

type Rep (Versioned a) Source # 
Instance details

Defined in Data.Yaml.Util

type Rep (Versioned a) = D1 (MetaData "Versioned" "Data.Yaml.Util" "hgeometry-0.8.0.0-2B18HmKepFxHOPvqiUEkND" False) (C1 (MetaCons "Versioned" PrefixI True) (S1 (MetaSel (Just "version") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Version) :*: S1 (MetaSel (Just "content") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a)))