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

-- | Haskell 98 phantom types to avoid unsafely passing dummy arguments
--   
--   Haskell 98 phantom types to avoid unsafely passing dummy arguments.
@package tagged
@version 0.8.9

module Data.Proxy.TH

-- | A proxy value quasiquoter. [pr|T|] will splice an expression
--   Proxy::Proxy T, while [pr|A,B,C|] will splice in a
--   value of Proxy :: Proxy [A,B,C].
pr :: QuasiQuoter

-- | Like pr, but takes a single type, which is used to produce a
--   Proxy for a single-element list containing only that type. This
--   is useful for passing a single type to a function that wants a list of
--   types.
pr1 :: QuasiQuoter

module Data.Tagged

-- | A Tagged s b value is a value b with an
--   attached phantom type s. This can be used in place of the
--   more traditional but less safe idiom of passing in an undefined value
--   with the type, because unlike an (s -> b), a
--   Tagged s b can't try to use the argument s as
--   a real value.
--   
--   Moreover, you don't have to rely on the compiler to inline away the
--   extra argument, because the newtype is "free"
--   
--   Tagged has kind k -> * -> * if the compiler
--   supports PolyKinds, therefore there is an extra k
--   showing in the instance haddocks that may cause confusion.
newtype Tagged (s :: k) b
Tagged :: b -> Tagged (s :: k) b
[unTagged] :: Tagged (s :: k) b -> b

-- | Some times you need to change the tag you have lying around. Idiomatic
--   usage is to make a new combinator for the relationship between the
--   tags that you want to enforce, and define that combinator using
--   retag.
--   
--   
--   data Succ n
--   retagSucc :: Tagged n a -> Tagged (Succ n) a
--   retagSucc = retag
--   
retag :: forall {k1} {k2} (s :: k1) b (t :: k2). Tagged s b -> Tagged t b

-- | Alias for unTagged
untag :: forall {k} (s :: k) b. Tagged s b -> b

-- | Tag a value with its own type.
tagSelf :: a -> Tagged a a

-- | untagSelf is a type-restricted version of untag.
untagSelf :: Tagged a a -> a

-- | asTaggedTypeOf is a type-restricted version of const. It
--   is usually used as an infix operator, and its typing forces its first
--   argument (which is usually overloaded) to have the same type as the
--   tag of the second.
asTaggedTypeOf :: forall {k} s tagged (b :: k). s -> tagged s b -> s
witness :: Tagged a b -> a -> b

-- | Convert from a Tagged representation to a representation based
--   on a Proxy.
proxy :: forall {k} (s :: k) a proxy. Tagged s a -> proxy s -> a

-- | Convert from a representation based on a Proxy to a
--   Tagged representation.
unproxy :: forall {k} (s :: k) a. (Proxy s -> a) -> Tagged s a

-- | Another way to convert a proxy to a tag.
tagWith :: forall {k} proxy (s :: k) a. proxy s -> a -> Tagged s a

-- | Some times you need to change the proxy you have lying around.
--   Idiomatic usage is to make a new combinator for the relationship
--   between the proxies that you want to enforce, and define that
--   combinator using reproxy.
--   
--   
--   data Succ n
--   reproxySucc :: proxy n -> Proxy (Succ n)
--   reproxySucc = reproxy
--   
reproxy :: forall {k1} {k2} proxy (a :: k1) (b :: k2). proxy a -> Proxy b
instance forall k (s :: k). GHC.Internal.Base.Applicative (Data.Tagged.Tagged s)
instance Data.Bifoldable1.Bifoldable1 Data.Tagged.Tagged
instance Data.Bifoldable.Bifoldable Data.Tagged.Tagged
instance Data.Bifunctor.Bifunctor Data.Tagged.Tagged
instance Data.Bitraversable.Bitraversable Data.Tagged.Tagged
instance forall k a (s :: k). GHC.Internal.Bits.Bits a => GHC.Internal.Bits.Bits (Data.Tagged.Tagged s a)
instance forall k (s :: k) b. GHC.Internal.Enum.Bounded b => GHC.Internal.Enum.Bounded (Data.Tagged.Tagged s b)
instance (GHC.Internal.Data.Data.Data s, GHC.Internal.Data.Data.Data b) => GHC.Internal.Data.Data.Data (Data.Tagged.Tagged s b)
instance forall k a (s :: k). GHC.Internal.Enum.Enum a => GHC.Internal.Enum.Enum (Data.Tagged.Tagged s a)
instance forall k (s :: k). Data.Functor.Classes.Eq1 (Data.Tagged.Tagged s)
instance Data.Functor.Classes.Eq2 Data.Tagged.Tagged
instance forall k (s :: k) b. GHC.Classes.Eq b => GHC.Classes.Eq (Data.Tagged.Tagged s b)
instance forall k a (s :: k). GHC.Internal.Bits.FiniteBits a => GHC.Internal.Bits.FiniteBits (Data.Tagged.Tagged s a)
instance forall k a (s :: k). GHC.Internal.Float.Floating a => GHC.Internal.Float.Floating (Data.Tagged.Tagged s a)
instance forall k (a :: k). Data.Foldable1.Foldable1 (Data.Tagged.Tagged a)
instance forall k (s :: k). GHC.Internal.Data.Foldable.Foldable (Data.Tagged.Tagged s)
instance forall k a (s :: k). GHC.Internal.Real.Fractional a => GHC.Internal.Real.Fractional (Data.Tagged.Tagged s a)
instance forall k (s :: k). GHC.Internal.Base.Functor (Data.Tagged.Tagged s)
instance forall k (s :: k). GHC.Internal.Generics.Generic1 (Data.Tagged.Tagged s)
instance forall k (s :: k) b. GHC.Internal.Generics.Generic (Data.Tagged.Tagged s b)
instance forall k a (s :: k). GHC.Internal.Real.Integral a => GHC.Internal.Real.Integral (Data.Tagged.Tagged s a)
instance forall k a (s :: k). GHC.Internal.Data.String.IsString a => GHC.Internal.Data.String.IsString (Data.Tagged.Tagged s a)
instance forall k (s :: k) b. GHC.Internal.Ix.Ix b => GHC.Internal.Ix.Ix (Data.Tagged.Tagged s b)
instance forall k (s :: k). GHC.Internal.Base.Monad (Data.Tagged.Tagged s)
instance forall k a (s :: k). (GHC.Internal.Base.Semigroup a, GHC.Internal.Base.Monoid a) => GHC.Internal.Base.Monoid (Data.Tagged.Tagged s a)
instance forall k b (s :: k). Control.DeepSeq.NFData b => Control.DeepSeq.NFData (Data.Tagged.Tagged s b)
instance forall k a (s :: k). GHC.Internal.Num.Num a => GHC.Internal.Num.Num (Data.Tagged.Tagged s a)
instance forall k (s :: k). Data.Functor.Classes.Ord1 (Data.Tagged.Tagged s)
instance Data.Functor.Classes.Ord2 Data.Tagged.Tagged
instance forall k (s :: k) b. GHC.Classes.Ord b => GHC.Classes.Ord (Data.Tagged.Tagged s b)
instance forall k (s :: k). Data.Functor.Classes.Read1 (Data.Tagged.Tagged s)
instance Data.Functor.Classes.Read2 Data.Tagged.Tagged
instance forall k b (s :: k). GHC.Internal.Read.Read b => GHC.Internal.Read.Read (Data.Tagged.Tagged s b)
instance forall k a (s :: k). GHC.Internal.Float.RealFloat a => GHC.Internal.Float.RealFloat (Data.Tagged.Tagged s a)
instance forall k a (s :: k). GHC.Internal.Real.RealFrac a => GHC.Internal.Real.RealFrac (Data.Tagged.Tagged s a)
instance forall k a (s :: k). GHC.Internal.Real.Real a => GHC.Internal.Real.Real (Data.Tagged.Tagged s a)
instance forall k a (s :: k). GHC.Internal.Base.Semigroup a => GHC.Internal.Base.Semigroup (Data.Tagged.Tagged s a)
instance forall k (s :: k). Data.Functor.Classes.Show1 (Data.Tagged.Tagged s)
instance Data.Functor.Classes.Show2 Data.Tagged.Tagged
instance forall k b (s :: k). GHC.Internal.Show.Show b => GHC.Internal.Show.Show (Data.Tagged.Tagged s b)
instance forall k a (s :: k). GHC.Internal.Foreign.Storable.Storable a => GHC.Internal.Foreign.Storable.Storable (Data.Tagged.Tagged s a)
instance forall k (s :: k). GHC.Internal.Data.Traversable.Traversable (Data.Tagged.Tagged s)
