Safe Haskell | Safe-Inferred |
---|
Data.Typeable.Extra
Description
This module extends Data.Typeable with extra functions available in later GHC versions. The package also exports the existing Data.Typeable functions.
Documentation
typeRep :: forall proxy a. Typeable a => proxy a -> TypeRep
Takes a value of type a
and returns a concrete representation
of that type.
typeRep (Proxy :: Proxy Int) == typeOf (1 :: Int)
data a :~: b where
Propositional equality. If a :~: b
is inhabited by some terminating
value, then the type a
is the same as the type b
. To use this equality
in practice, pattern-match on the a :~: b
to get out the Refl
constructor;
in the body of the pattern-match, the compiler knows that a ~ b
.