A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://hackage.haskell.org/packages/archive/base/4.6.0.0/doc/html/Data-Typeable.html below:

Data.Typeable

Description

The Typeable class reifies types to some extent by associating type representations to types. These type representations can be compared, and one can in turn define a type-safe cast operation. To this end, an unsafe cast is guarded by a test for type (representation) equivalence. The module Data.Dynamic uses Typeable for an implementation of dynamics. The module Data.Data uses Typeable and type-safe cast (but not dynamics) to support the "Scrap your boilerplate" style of generic programming.

The Typeable class

class Typeable a whereSource

The class Typeable allows a concrete representation of a type to be calculated.

Methods

typeOf :: a -> TypeRepSource

Takes a value of type a and returns a concrete representation of that type. The value of the argument should be ignored by any instance of Typeable, so that it is safe to pass undefined as the argument.

Type-safe cast Type representations

data TypeRep Source

A concrete representation of a (monomorphic) type. TypeRep supports reasonably efficient equality.

showsTypeRep :: TypeRep -> ShowSSource

tyConPackage :: TyCon -> StringSource

tyConModule :: TyCon -> StringSource

tyConName :: TyCon -> StringSource

Construction of type representations

mkTyConSource

Deprecated: either derive Typeable, or use mkTyCon3 instead

Backwards-compatible API

mkTyCon3Source

Builds a TyCon object representing a type constructor. An implementation of Data.Typeable should ensure that the following holds:

  A==A' ^ B==B' ^ C==C' ==> mkTyCon A B C == mkTyCon A' B' C'
Observation of type representations The other Typeable classes

Note: The general instances are provided for GHC only.

Default instances

Note: These are not needed by GHC, for which these instances are generated by general instance declarations.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4