-- 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 reproxy.
--   
--   
--   data Succ n
--   reproxySucc :: proxy n -> Proxy (Succ n)
--   reproxySucc = reproxy
--   
reproxy :: proxy s -> Proxy t

-- | asProxyTypeOf 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.
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 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"
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
--   retag.
--   
--   
--   data Succ n
--   retagSucc :: Tagged n a -> Tagged (Succ n) a
--   retagSucc = retag
--   
retag :: Tagged s b -> Tagged t b

-- | Alias for unTagged
untag :: 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 :: s -> tagged s b -> s
witness :: Tagged a b -> a -> b

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

-- | Convert from a representation based on a Proxy to a
--   Tagged 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 *)
