-- 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.7


module Data.Proxy
data Proxy s
Proxy :: Proxy s

-- | 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 <a>reproxy</a>.
--   
--   <pre>
--   data Succ n
--   reproxySucc :: proxy n -&gt; Proxy (Succ n)
--   reproxySucc = reproxy
--   </pre>
reproxy :: proxy s -> Proxy t

-- | <a>asProxyTypeOf</a> is a type-restricted version of <a>const</a>. 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.
asProxyTypeOf :: a -> proxy a -> a
instance Traversable (Proxy *)
instance Foldable (Proxy *)
instance Monad (Proxy *)
instance Monoid (Proxy k s)
instance Applicative (Proxy *)
instance Functor (Proxy *)
instance Bounded (Proxy k s)
instance Ix (Proxy k s)
instance Enum (Proxy k s)
instance Data s => Data (Proxy * s)
instance Typeable1 (Proxy *)
instance Read (Proxy k s)
instance Show (Proxy k s)
instance Ord (Proxy k s)
instance Eq (Proxy k s)


module Data.Tagged

-- | A <tt><a>Tagged</a> s b</tt> value is a value <tt>b</tt> with an
--   attached phantom type <tt>s</tt>. 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 <tt>(s -&gt; b)</tt>, a
--   <tt><a>Tagged</a> s b</tt> can't try to use the argument <tt>s</tt> 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"
newtype Tagged s b
Tagged :: b -> Tagged s b
unTagged :: Tagged s 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
--   <a>retag</a>.
--   
--   <pre>
--   data Succ n
--   retagSucc :: <a>Tagged</a> n a -&gt; <a>Tagged</a> (Succ n) a
--   retagSucc = <a>retag</a>
--   </pre>
retag :: Tagged s b -> Tagged t b

-- | Alias for <a>unTagged</a>
untag :: Tagged s b -> b

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

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

-- | <a>asTaggedTypeOf</a> is a type-restricted version of <a>const</a>. 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 :: s -> tagged s b -> s
witness :: Tagged a b -> a -> b

-- | Convert from a <a>Tagged</a> representation to a representation based
--   on a <a>Proxy</a>.
proxy :: Tagged s a -> proxy s -> a

-- | Convert from a representation based on a <a>Proxy</a> to a
--   <a>Tagged</a> representation.
unproxy :: (Proxy s -> a) -> Tagged s a
instance Eq b => Eq (Tagged k s b)
instance Ord b => Ord (Tagged k s b)
instance Ix b => Ix (Tagged k s b)
instance Bounded b => Bounded (Tagged k s b)
instance RealFloat a => RealFloat (Tagged k s a)
instance RealFrac a => RealFrac (Tagged k s a)
instance Floating a => Floating (Tagged k s a)
instance Fractional a => Fractional (Tagged k s a)
instance Integral a => Integral (Tagged k s a)
instance Real a => Real (Tagged k s a)
instance Num a => Num (Tagged k s a)
instance Enum a => Enum (Tagged k s a)
instance Traversable (Tagged k s)
instance Foldable (Tagged k s)
instance Monad (Tagged k s)
instance Applicative (Tagged k s)
instance Functor (Tagged k s)
instance Monoid a => Monoid (Tagged k s a)
instance Read b => Read (Tagged k s b)
instance Show b => Show (Tagged k s b)
instance (Data s, Data b) => Data (Tagged * s b)
instance Typeable2 (Tagged *)
