{-# OPTIONS_GHC -fno-warn-missing-fields #-}

-- | Literal, uninterpolated here docs
module Data.String.Here.Uninterpolated (here, hereFile, hereLit) where

import Language.Haskell.TH
import Language.Haskell.TH.Quote

import Data.String.Here.Internal

-- | Quote a here doc, stripping leading and trailing whitespace
here :: QuasiQuoter
here :: QuasiQuoter
here = QuasiQuoter :: (String -> Q Exp)
-> (String -> Q Pat)
-> (String -> Q Type)
-> (String -> Q [Dec])
-> QuasiQuoter
QuasiQuoter {quoteExp :: String -> Q Exp
quoteExp = String -> Q Exp
stringE (String -> Q Exp) -> (String -> String) -> String -> Q Exp
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> String
trim}

-- | Quote a here doc literally, with no whitespace stripping
hereLit :: QuasiQuoter
hereLit :: QuasiQuoter
hereLit = QuasiQuoter :: (String -> Q Exp)
-> (String -> Q Pat)
-> (String -> Q Type)
-> (String -> Q [Dec])
-> QuasiQuoter
QuasiQuoter {quoteExp :: String -> Q Exp
quoteExp = String -> Q Exp
stringE}

-- | Splice a file's contents as a here doc
hereFile :: QuasiQuoter
hereFile :: QuasiQuoter
hereFile = QuasiQuoter -> QuasiQuoter
quoteDependentFile QuasiQuoter
hereLit