1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
{-# LANGUAGE Trustworthy #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE PatternSynonyms #-}
-----------------------------------------------------------------------------
-- |
-- Module : Type.Reflection
-- Copyright : (c) The University of Glasgow, CWI 2001--2017
-- License : BSD-style (see the file libraries/base/LICENSE)
--
-- Maintainer : libraries@haskell.org
-- Stability : experimental
-- Portability : non-portable (requires GADTs and compiler support)
--
-- This provides a type-indexed type representation mechanism, similar to that
-- described by,
--
-- * Simon Peyton-Jones, Stephanie Weirich, Richard Eisenberg,
-- Dimitrios Vytiniotis. "A reflection on types."
-- /Proc. Philip Wadler's 60th birthday Festschrift/, Edinburgh (April 2016).
--
-- The interface provides 'I.TypeRep', a type representation which can
-- be safely decomposed and composed. See "Data.Dynamic" for an example of this.
--
-- @since 4.10.0.0
--
-----------------------------------------------------------------------------
module Type.Reflection
( -- * The Typeable class
I.Typeable
, I.typeRep
, I.withTypeable
-- * Propositional equality
, (:~:)(Refl)
, (:~~:)(HRefl)
-- * Type representations
-- ** Type-Indexed
, I.TypeRep
, I.typeOf
, pattern I.App, pattern I.Con, pattern I.Con', pattern I.Fun
, I.typeRepTyCon
, I.rnfTypeRep
, I.eqTypeRep
, I.typeRepKind
, I.splitApps
-- ** Quantified
--
-- "Data.Typeable" exports a variant of this interface (named differently
-- for backwards compatibility).
, I.SomeTypeRep(..)
, I.someTypeRep
, I.someTypeRepTyCon
, I.rnfSomeTypeRep
-- * Type constructors
, I.TyCon -- abstract, instance of: Eq, Show, Typeable
-- For now don't export Module, to avoid name clashes
, I.tyConPackage
, I.tyConModule
, I.tyConName
, I.rnfTyCon
-- * Module names
, I.Module
, I.moduleName, I.modulePackage, I.rnfModule
) where
import qualified Data.Typeable.Internal as I
import Data.Type.Equality
|