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


-- | Derive Template Haskell's Lift class for datatypes.
--   
--   Derive Template Haskell's Lift class for datatypes.
@package th-lift
@version 0.7.6

module Language.Haskell.TH.Lift

-- | Derive Lift instances for the given datatype.
deriveLift :: Name -> Q [Dec]

-- | Derive Lift instances for many datatypes.
deriveLiftMany :: [Name] -> Q [Dec]

-- | Obtain Info values through a custom reification function. This is
--   useful when generating instances for datatypes that have not yet been
--   declared.
deriveLift' :: Info -> Q [Dec]
deriveLiftMany' :: [Info] -> Q [Dec]

-- | Generates a lambda expresson which behaves like <a>lift</a> (without
--   requiring a <a>Lift</a> instance). Example:
--   
--   <pre>
--   newtype Fix f = In { out :: f (Fix f) }
--   
--   instance Lift (f (Fix f)) =&gt; Lift (Fix f) where
--     lift = $(makeLift ''Fix)
--   </pre>
makeLift :: Name -> Q Exp

-- | Like <a>makeLift</a>, but using a custom reification function.
makeLift' :: Info -> Q Exp

-- | A <a>Lift</a> instance can have any of its values turned into a
--   Template Haskell expression. This is needed when a value used within a
--   Template Haskell quotation is bound outside the Oxford brackets
--   (<tt>[| ... |]</tt>) but not at the top level. As an example:
--   
--   <pre>
--   add1 :: Int -&gt; Q Exp
--   add1 x = [| x + 1 |]
--   </pre>
--   
--   Template Haskell has no way of knowing what value <tt>x</tt> will take
--   on at splice-time, so it requires the type of <tt>x</tt> to be an
--   instance of <a>Lift</a>.
--   
--   <a>Lift</a> instances can be derived automatically by use of the
--   <tt>-XDeriveLift</tt> GHC language extension:
--   
--   <pre>
--   {-# LANGUAGE DeriveLift #-}
--   module Foo where
--   
--   import Language.Haskell.TH.Syntax
--   
--   data Bar a = Bar1 a (Bar a) | Bar2 String
--     deriving Lift
--   </pre>
class Lift t

-- | Turn a value into a Template Haskell expression, suitable for use in a
--   splice.
lift :: t -> Q Exp
instance Language.Haskell.TH.Syntax.Lift Language.Haskell.TH.Syntax.Name
instance Language.Haskell.TH.Syntax.Lift Language.Haskell.TH.Syntax.OccName
instance Language.Haskell.TH.Syntax.Lift Language.Haskell.TH.Syntax.PkgName
instance Language.Haskell.TH.Syntax.Lift Language.Haskell.TH.Syntax.ModName
instance Language.Haskell.TH.Syntax.Lift Language.Haskell.TH.Syntax.NameFlavour
instance Language.Haskell.TH.Syntax.Lift Language.Haskell.TH.Syntax.NameSpace
