Safe Haskell | None |
---|---|
Language | Haskell2010 |
Data.Yaml.TH
Contents
Synopsis
- yamlQQ :: QuasiQuoter
- decodeFile :: forall a. (Lift a, FromJSON a) => FilePath -> Q (TExp a)
- data Value
- data Parser a
- type Object = HashMap Text Value
- type Array = Vector Value
- object :: [Pair] -> Value
- array :: [Value] -> Value
- (.=) :: (KeyValue kv, ToJSON v) => Text -> v -> kv
- (.:) :: FromJSON a => Object -> Text -> Parser a
- (.:?) :: FromJSON a => Object -> Text -> Parser (Maybe a)
- (.!=) :: Parser (Maybe a) -> a -> Parser a
- class FromJSON a where
Decoding
yamlQQ :: QuasiQuoter Source #
A QuasiQuoter
for YAML.
Examples
{-# LANGUAGE QuasiQuotes #-} import Data.Yaml.TH value :: Value value = [yamlQQ| name: John Doe age: 23 |]
Since: 0.8.28.0
decodeFile :: forall a. (Lift a, FromJSON a) => FilePath -> Q (TExp a) Source #
Decode a YAML file at compile time. Only available on GHC version 7.8.1
or higher.
Examples
{-# LANGUAGE TemplateHaskell #-}
config :: Config
config = $$(decodeFile
"config.yaml")
Since: 0.8.19.0
Re-exports from Data.Yaml
Instances
Eq Value | |
Data Value | |
Defined in Data.Aeson.Types.Internal Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Value -> c Value gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Value dataTypeOf :: Value -> DataType dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Value) dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Value) gmapT :: (forall b. Data b => b -> b) -> Value -> Value gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Value -> r gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Value -> r gmapQ :: (forall d. Data d => d -> u) -> Value -> [u] gmapQi :: Int -> (forall d. Data d => d -> u) -> Value -> u gmapM :: Monad m => (forall d. Data d => d -> m d) -> Value -> m Value gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Value -> m Value gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Value -> m Value | |
Read Value | |
Defined in Data.Aeson.Types.Internal | |
Show Value | |
IsString Value | |
Defined in Data.Aeson.Types.Internal Methods fromString :: String -> Value | |
Generic Value | |
Lift Value | |
Defined in Data.Aeson.Types.Internal | |
FromJSON Value | |
KeyValue Object | |
Defined in Data.Aeson.Types.ToJSON | |
KeyValue Pair | |
Defined in Data.Aeson.Types.ToJSON | |
ToJSON Value | |
Defined in Data.Aeson.Types.ToJSON Methods toEncoding :: Value -> Encoding # toJSONList :: [Value] -> Value # toEncodingList :: [Value] -> Encoding # | |
Hashable Value | |
Defined in Data.Aeson.Types.Internal | |
NFData Value | |
Defined in Data.Aeson.Types.Internal | |
FromString Encoding | |
Defined in Data.Aeson.Types.ToJSON Methods fromString :: String -> Encoding | |
FromString Value | |
Defined in Data.Aeson.Types.ToJSON Methods fromString :: String -> Value | |
GToJSON Encoding arity (U1 :: Type -> Type) | |
Defined in Data.Aeson.Types.ToJSON Methods gToJSON :: Options -> ToArgs Encoding arity a -> U1 a -> Encoding | |
GToJSON Value arity (V1 :: Type -> Type) | |
Defined in Data.Aeson.Types.ToJSON | |
GToJSON Value arity (U1 :: Type -> Type) | |
Defined in Data.Aeson.Types.ToJSON | |
ToJSON1 f => GToJSON Encoding One (Rec1 f) | |
Defined in Data.Aeson.Types.ToJSON Methods gToJSON :: Options -> ToArgs Encoding One a -> Rec1 f a -> Encoding | |
ToJSON1 f => GToJSON Value One (Rec1 f) | |
Defined in Data.Aeson.Types.ToJSON | |
ToJSON a => GToJSON Encoding arity (K1 i a :: Type -> Type) | |
Defined in Data.Aeson.Types.ToJSON Methods gToJSON :: Options -> ToArgs Encoding arity a0 -> K1 i a a0 -> Encoding | |
(EncodeProduct arity a, EncodeProduct arity b) => GToJSON Encoding arity (a :*: b) | |
Defined in Data.Aeson.Types.ToJSON Methods gToJSON :: Options -> ToArgs Encoding arity a0 -> (a :*: b) a0 -> Encoding | |
ToJSON a => GToJSON Value arity (K1 i a :: Type -> Type) | |
Defined in Data.Aeson.Types.ToJSON | |
(WriteProduct arity a, WriteProduct arity b, ProductSize a, ProductSize b) => GToJSON Value arity (a :*: b) | |
Defined in Data.Aeson.Types.ToJSON | |
(ToJSON1 f, GToJSON Encoding One g) => GToJSON Encoding One (f :.: g) | |
Defined in Data.Aeson.Types.ToJSON Methods gToJSON :: Options -> ToArgs Encoding One a -> (f :.: g) a -> Encoding | |
(ToJSON1 f, GToJSON Value One g) => GToJSON Value One (f :.: g) | |
Defined in Data.Aeson.Types.ToJSON | |
FromPairs Value (DList Pair) | |
Defined in Data.Aeson.Types.ToJSON | |
v ~ Value => KeyValuePair v (DList Pair) | |
Defined in Data.Aeson.Types.ToJSON Methods pair :: String -> v -> DList Pair | |
(GToJSON Encoding arity a, ConsToJSON Encoding arity a, Constructor c) => SumToJSON' TwoElemArray Encoding arity (C1 c a) | |
Defined in Data.Aeson.Types.ToJSON Methods sumToJSON' :: Options -> ToArgs Encoding arity a0 -> C1 c a a0 -> Tagged TwoElemArray Encoding | |
(GToJSON Value arity a, ConsToJSON Value arity a, Constructor c) => SumToJSON' TwoElemArray Value arity (C1 c a) | |
Defined in Data.Aeson.Types.ToJSON Methods sumToJSON' :: Options -> ToArgs Value arity a0 -> C1 c a a0 -> Tagged TwoElemArray Value | |
type Rep Value | |
Defined in Data.Aeson.Types.Internal type Rep Value = D1 (MetaData "Value" "Data.Aeson.Types.Internal" "aeson-1.4.6.0-GW12281wWczJyRiEaI3P58" False) ((C1 (MetaCons "Object" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Object)) :+: (C1 (MetaCons "Array" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Array)) :+: C1 (MetaCons "String" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Text)))) :+: (C1 (MetaCons "Number" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Scientific)) :+: (C1 (MetaCons "Bool" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Bool)) :+: C1 (MetaCons "Null" PrefixI False) (U1 :: Type -> Type)))) |
Minimal complete definition
Nothing