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

-- | Lift a type from a Typeable constraint to a Template Haskell type
--   
--   Lift your types from a Typeable constraint to a Template Haskell type
@package lift-type
@version 0.1.2.0

-- | Template Haskell has a class Lift that allows you to promote
--   values from Haskell-land into the land of metaprogramming - Q.
--   
--   
--   class Lift a where
--       lift :: a -> Q Exp
--   
--       liftTyped :: a -> Q (TExp a)
--   
--   
--   However, there wasn't a way to promote a *type* into a Q
--   Type.
--   
--   This library provides exactly that function. It requires a
--   Typeable constraint, but this is automatically satisfied by
--   GHC.
module LiftType

-- | Convert a type argument into a Template Haskell Type.
--   
--   Use with TypeApplications.
--   
--   Example:
--   
--   
--   >>> :set -XTypeApplications
--   >>> liftType @Bool
--   ConT GHC.Types.Bool
--   >>> liftType @[Char]
--   AppT (ConT GHC.Types.[]) (ConT GHC.Types.Char)
--   
--   
--   This works with data kinds, too.
--   
--   
--   >>> :set -XDataKinds
--   >>> liftType @3
--   LitT (NumTyLit 3)
--   >>> liftType @"hello"
--   LitT (StrTyLit "hello")
--   >>> liftType @'[Int, Char]
--   AppT (AppT (PromotedT GHC.Types.:) (ConT GHC.Types.Int)) (AppT (AppT (PromotedT GHC.Types.:) (ConT GHC.Types.Char)) (PromotedT GHC.Types.[]))
--   >>> liftType @'(Int, Char)
--   AppT (AppT (PromotedT GHC.Tuple.(,)) (ConT GHC.Types.Int)) (ConT GHC.Types.Char)
--   
liftType :: forall {k} (t :: k). Typeable t => Type

-- | liftType promoted to the Q monad.
liftTypeQ :: forall {k} (t :: k). Typeable t => Q Type

-- | Promote a SomeTypeRep into a Type.
typeRepToType :: SomeTypeRep -> Type

-- | Extract the TypeOrDataName from a TyCon. You probably
--   want to use typeToName instead. See that function for
--   documentation and more information.
tyConToName :: TyCon -> TypeOrDataName

-- | This function returns the name of the outermost type constructor.
--   
--   
--   >>> typeToName @Char
--   TypeName ''Char
--   
--   >>> typeToName @Maybe
--   TypeName ''Maybe
--   
--   >>> typeToName @(Maybe Char)
--   TypeName ''Maybe
--   
--   >>> typeToName @(Int -> Char)
--   TypeName ''(->)
--   
--   >>> typeToName @'False
--   PromotedDataName 'False
--   
typeToName :: forall {k} (t :: k). Typeable t => TypeOrDataName

-- | It's possible to use a data constructor with a DataKinds
--   promotion. This disambiguates where the name comes from.
data TypeOrDataName
TypeName :: Name -> TypeOrDataName
PromotedDataName :: Name -> TypeOrDataName

-- | Retrieve the Name from a TypeOrDataName, forgetting how
--   it was parsed.
getTypeOrDataName :: TypeOrDataName -> Name
instance GHC.Classes.Eq LiftType.TypeOrDataName
instance GHC.Internal.Show.Show LiftType.TypeOrDataName
