on master help sign in
Add documentation for yamlQQ
commit2736d21ffda79a2d3d28c29870a58114749b7c45 authorSimon Hengel <sol@typeful.net> dateWed 17 Jan 2018, 00:48 (9 years ago) parent7f1aaa1
1 file changed+17−1
Data/Yaml/TH.hs+17−1
Data/Yaml/TH.hs+17−1
@@ -31,7 +31,7 @@ import Language.Haskell.TH.Quote
3131import Data.Yaml hiding (decodeFile)
3232
3333#if MIN_VERSION_template_haskell(2,9,0)
34−-- | Decode a @yaml@ file at compile time. Only available on GHC version @7.8.1@
34+-- | Decode a YAML file at compile time. Only available on GHC version @7.8.1@
3535-- or higher.
3636--
3737-- @since 0.8.19.0
@@ -60,6 +60,22 @@ yamlExp input = case decodeValue input of
6060 Left err -> fail err
6161 Right a -> lift a
6262
63+-- | A @QuasiQuoter@ for YAML.
64+--
65+-- @since 0.8.28.0
66+--
67+-- ==== __Examples__
68+--
69+-- @
70+-- {-\# LANGUAGE QuasiQuotes \#-}
71+-- import Data.Yaml.TH
72+--
73+-- value :: Value
74+-- value = [yamlQQ|
75+-- name: John Doe
76+-- age: 23
77+-- |]
78+-- @
6379yamlQQ :: QuasiQuoter
6480yamlQQ = QuasiQuoter {
6581 quoteExp = yamlExp