-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | The stable home of TemplateHaskell's <a>QuasiQuoter</a> interface.
@package template-haskell-quasiquoter
@version 0.1.0.0

module Language.Haskell.TH.QuasiQuoter

-- | The <a>QuasiQuoter</a> type, a value <tt>q</tt> of this type can be
--   used in the syntax <tt>[q| ... string to parse ...|]</tt>. In fact,
--   for convenience, a <a>QuasiQuoter</a> actually defines multiple
--   quasiquoters to be used in different splice contexts; if you are only
--   interested in defining a quasiquoter to be used for expressions, you
--   would define a <a>QuasiQuoter</a> with only <a>quoteExp</a>, and leave
--   the other fields stubbed out with errors.
data QuasiQuoter
QuasiQuoter :: (String -> Q Exp) -> (String -> Q Pat) -> (String -> Q Type) -> (String -> Q [Dec]) -> QuasiQuoter

-- | Quasi-quoter for expressions, invoked by quotes like <tt>lhs =
--   $[q|...]</tt>
[quoteExp] :: QuasiQuoter -> String -> Q Exp

-- | Quasi-quoter for patterns, invoked by quotes like <tt>f $[q|...] =
--   rhs</tt>
[quotePat] :: QuasiQuoter -> String -> Q Pat

-- | Quasi-quoter for types, invoked by quotes like <tt>f :: $[q|...]</tt>
[quoteType] :: QuasiQuoter -> String -> Q Type

-- | Quasi-quoter for declarations, invoked by top-level quotes
[quoteDec] :: QuasiQuoter -> String -> Q [Dec]

-- | A <a>QuasiQuoter</a> that fails with a helpful error message in every
--   context. It is intended to be modified to create a <a>QuasiQuoter</a>
--   that fails in all inappropriate contexts.
--   
--   For example, you could write
--   
--   <pre>
--   myPatQQ = (namedDefaultQuasiQuoter "myPatQQ")
--     { quotePat = ... }
--   </pre>
--   
--   If <tt>myPatQQ</tt> is used in an expression context, the compiler
--   will report that, naming <tt>myPatQQ</tt>.
--   
--   See also <a>defaultQuasiQuoter</a>, which does not name the
--   <a>QuasiQuoter</a> in the error message, and might therefore be more
--   appropriate when the users of a particular <a>QuasiQuoter</a> tend to
--   define local "synonyms" for it.
namedDefaultQuasiQuoter :: String -> QuasiQuoter

-- | A <a>QuasiQuoter</a> that fails with a helpful error message in every
--   context. It is intended to be modified to create a <a>QuasiQuoter</a>
--   that fails in all inappropriate contexts.
--   
--   For example, you could write
--   
--   <pre>
--   myExpressionQQ = defaultQuasiQuoter
--     { quoteExp = ... }
--   </pre>
--   
--   See also <a>namedDefaultQuasiQuoter</a>, which names the
--   <a>QuasiQuoter</a> in the error messages.
defaultQuasiQuoter :: QuasiQuoter

-- | In short, <a>Q</a> provides the <a>Quasi</a> operations in one neat
--   monad for the user.
--   
--   The longer story, is that <a>Q</a> wraps an arbitrary
--   <a>Quasi</a>-able monad. The perceptive reader notices that
--   <a>Quasi</a> has only two instances, <a>Q</a> itself and <a>IO</a>,
--   neither of which have concrete implementations.<a>Q</a> plays the
--   trick of <a>dependency inversion</a>, providing an abstract interface
--   for the user which is later concretely fufilled by an concrete
--   <a>Quasi</a> instance, internal to GHC.
data Q a

-- | A Haskell expression.
data Exp

-- | Pattern in Haskell given in <tt>{}</tt>
data Pat

-- | A Haskell type.
data Type

-- | A single declaration.
data Dec
