@@ -23,19 +23,22 @@ import Data.Yaml hiding (decodeFile)
2323import Language.Haskell.TH
2424import Language.Haskell.TH.Syntax
2525
26−-- | Decode a @yaml@ file at compile time.
26+-- | Decode a @yaml@ file at compile time. Only available on GHC version @7.8.1@
27+-- or higher.
28+--
29+-- @since 0.8.19.0
30+--
31+-- ==== __Examples__
2732--
2833-- @
29−-- {-# LANGUAGE TemplateHaskell #-}
34+-- {-\# LANGUAGE TemplateHaskell \#-}
3035--
3136-- config :: Config
3237-- config = $$('decodeFile' "config.yaml")
3338-- @
34−--
35−-- @since 0.8.19.0
3639decodeFile :: forall a. (Lift a, FromJSON a) => FilePath -> Q (TExp a)
3740decodeFile path = do
3841 addDependentFile path
3942 runIO (decodeFileEither path) >>= \case
4043 Left err -> fail (prettyPrintParseException err)
41− Right x -> TExp <$> lift (x :: a)
44+ Right x -> fmap TExp (lift (x :: a))