Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Haxible.Eval
Description
This module contains the evaluation logic
Synopsis
- type AnsibleHaxl a = GenHaxl () () a
- runHaxible :: FilePath -> FilePath -> AnsibleHaxl [Value] -> IO ()
- runTask :: Vars -> Text -> Value -> Vars -> Vars -> AnsibleHaxl Value
- json :: QuasiQuoter
- envLoop :: Text -> [(Text, Value)] -> [Value]
- extractFact :: Value -> Value
- traverseLoop :: Applicative f => (a -> f Value) -> [a] -> f Value
- traverseInclude :: Applicative f => (a -> f [Value]) -> [a] -> f [Value]
- cleanVar :: Value -> Value
- tryRescue :: BlockFun -> BlockFun -> BlockFun
- data Value
- type Vars = [(Text, Value)]
Documentation
type AnsibleHaxl a = GenHaxl () () a Source #
runHaxible :: FilePath -> FilePath -> AnsibleHaxl [Value] -> IO () Source #
json :: QuasiQuoter Source #
envLoop :: Text -> [(Text, Value)] -> [Value] Source #
Evaluate template for the loop attribute when it is a string (instead of a list):
>>>
envLoop "{{ hosts }}" [("hosts", [json|["frontend", "backend"]|])]
[String "frontend",String "backend"]
extractFact :: Value -> Value Source #
traverseLoop :: Applicative f => (a -> f Value) -> [a] -> f Value Source #
Build the loop results:
>>>
dump =<< traverseLoop (pure . String) ["a", "b"]
{"changed":false,"msg":"All items completed","results":["a","b"],"skipped":false}
traverseInclude :: Applicative f => (a -> f [Value]) -> [a] -> f [Value] Source #
Concat nested results
>>>
dump =<< traverseInclude (\x -> pure [String x, Number 42]) ["a", "b"]
["a",42,"b",42]
tryRescue :: BlockFun -> BlockFun -> BlockFun Source #
Call the rescue block if the main block fails.
A JSON value represented as a Haskell value.
Instances
Arbitrary Value | Since: aeson-2.0.3.0 |
CoArbitrary Value | Since: aeson-2.0.3.0 |
Defined in Data.Aeson.Types.Internal Methods coarbitrary :: Value -> Gen b -> Gen b # | |
Function Value | Since: aeson-2.0.3.0 |
FromJSON Value | |
FromJSON PlaySyntax Source # | |
Defined in Haxible.Syntax | |
FromJSON TaskSyntax Source # | |
Defined in Haxible.Syntax | |
FromString Encoding | |
Defined in Data.Aeson.Types.ToJSON Methods fromString :: String -> Encoding | |
FromString Value | |
Defined in Data.Aeson.Types.ToJSON Methods fromString :: String -> Value | |
KeyValue Object | Constructs a singleton |
KeyValue Pair | |
ToJSON Value | |
Defined in Data.Aeson.Types.ToJSON | |
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 :: forall r r'. (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 # | |
IsString Value | |
Defined in Data.Aeson.Types.Internal Methods fromString :: String -> Value # | |
Generic Value | |
Read Value | |
Show Value | Since version 1.5.6.0 version object values are printed in lexicographic key order
|
NFData Value | |
Defined in Data.Aeson.Types.Internal | |
Eq Value | |
Ord Value | The ordering is total, consistent with Since: aeson-1.5.2.0 |
Hashable Value | |
Defined in Data.Aeson.Types.Internal | |
AsJSON Value | |
AsNumber Value | |
AsPrimitive Value | |
AsValue Value | |
FromGVal m Value | |
ToGVal m Value | Convert Aeson |
Defined in Text.Ginger.GVal | |
Lift Value | Since: aeson-0.11.0.0 |
(GToJSON' Encoding arity a, ConsToJSON Encoding arity a, Constructor c) => SumToJSON' TwoElemArray Encoding arity (C1 c a) | |
Defined in Data.Aeson.Types.ToJSON | |
(GToJSON' Value arity a, ConsToJSON Value arity a, Constructor c) => SumToJSON' TwoElemArray Value arity (C1 c a) | |
Defined in Data.Aeson.Types.ToJSON | |
GToJSON' Encoding arity (U1 :: TYPE LiftedRep -> Type) | |
GToJSON' Value arity (U1 :: TYPE LiftedRep -> Type) | |
GToJSON' Value arity (V1 :: TYPE LiftedRep -> Type) | |
ToJSON1 f => GToJSON' Encoding One (Rec1 f) | |
ToJSON1 f => GToJSON' Value One (Rec1 f) | |
(EncodeProduct arity a, EncodeProduct arity b) => GToJSON' Encoding arity (a :*: b) | |
ToJSON a => GToJSON' Encoding arity (K1 i a :: TYPE LiftedRep -> Type) | |
(WriteProduct arity a, WriteProduct arity b, ProductSize a, ProductSize b) => GToJSON' Value arity (a :*: b) | |
ToJSON a => GToJSON' Value arity (K1 i a :: TYPE LiftedRep -> Type) | |
(ToJSON1 f, GToJSON' Encoding One g) => GToJSON' Encoding One (f :.: g) | |
(ToJSON1 f, GToJSON' Value One g) => GToJSON' Value One (f :.: g) | |
FromPairs Value (DList Pair) | |
Defined in Data.Aeson.Types.ToJSON | |
v ~ Value => KeyValuePair v (DList Pair) | |
Defined in Data.Aeson.Types.ToJSON | |
ToGVal m (KeyMap Value) | |
type Rep Value | |
Defined in Data.Aeson.Types.Internal type Rep Value = D1 ('MetaData "Value" "Data.Aeson.Types.Internal" "aeson-2.0.3.0-JsfPu3yjR3HGiW0fNjQdVR" '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)))) | |
type Index Value | |
Defined in Data.Aeson.Lens | |
type IxValue Value | |
Defined in Data.Aeson.Lens |