Ticket #2438: Instances0.hs

File Instances0.hs, 4.5 KB (added by claus, 7 years ago)

split source, imported part

Line 
1{-# LANGUAGE CPP #-}
2{-# LANGUAGE TypeSynonymInstances #-}
3{-# LANGUAGE StandaloneDeriving #-}
4{-# LANGUAGE DeriveDataTypeable #-}
5
6module Instances0 where
7
8import GHC hiding(TyCon)
9import SrcLoc
10import RdrName
11import OccName
12import FastString
13import Bag
14import Module
15import BasicTypes
16import Var
17import ForeignCall
18
19import Data.Generics
20import NameSet
21import TypeRep
22import qualified TyCon
23
24#include "Typeable.h"
25
26abstractConstr   n = mkConstr (abstractDataType n) ("{abstract:"++n++"}") [] Prefix
27abstractDataType n = mkDataType n [abstractConstr n]
28
29-- Typeable
30
31INSTANCE_TYPEABLE0(SrcSpan,srcSpanTc,"SrcSpan")
32instance Data SrcSpan where
33  toConstr _   = abstractConstr "SrcSpan"
34  gunfold _ _  = error "gunfold"
35  dataTypeOf _ = mkNorepType "SrcSpan"
36
37INSTANCE_TYPEABLE0(Module,moduleTc,"Module")
38instance Data Module where
39  toConstr _   = abstractConstr "Module"
40  gunfold _ _  = error "gunfold"
41  dataTypeOf _ = mkNorepType "Module"
42
43INSTANCE_TYPEABLE0(ModuleName,moduleNameTc,"ModuleName")
44instance Data ModuleName where
45  toConstr _   = abstractConstr "ModuleName"
46  gunfold _ _  = error "gunfold"
47  dataTypeOf _ = mkNorepType "ModuleName"
48
49deriving instance Typeable RdrName
50deriving instance Data RdrName
51
52INSTANCE_TYPEABLE0(OccName,occNameTc,"OccName")
53instance Data OccName where
54  toConstr _   = abstractConstr "OccName"
55  gunfold _ _  = error "gunfold"
56  dataTypeOf _ = mkNorepType "OccName"
57
58INSTANCE_TYPEABLE0(Name,nameTc,"Name")
59instance Data Name where
60  toConstr _   = abstractConstr "Name"
61  gunfold _ _  = error "gunfold"
62  dataTypeOf _ = mkNorepType "Name"
63
64deriving instance Typeable FastString
65instance Data FastString where
66  toConstr _   = abstractConstr "FastString"
67  gunfold _ _  = error "gunfold"
68  dataTypeOf _ = mkNorepType "FastString"
69
70deriving instance Typeable HsExplicitForAll
71deriving instance Data HsExplicitForAll
72
73deriving instance Typeable HsBang
74deriving instance Data HsBang
75
76deriving instance Typeable Boxity
77deriving instance Data Boxity
78
79deriving instance Typeable OverLitVal
80deriving instance Data OverLitVal
81
82deriving instance Typeable RecFlag
83deriving instance Data RecFlag
84
85deriving instance Typeable BasicTypes.Fixity
86deriving instance Data BasicTypes.Fixity
87
88deriving instance Typeable HsArrAppType
89deriving instance Data HsArrAppType
90
91deriving instance Typeable FixityDirection
92deriving instance Data FixityDirection
93
94INSTANCE_TYPEABLE0(DataCon,dataConTc,"DataCon")
95instance Data DataCon where
96  toConstr _   = abstractConstr "DataCon"
97  gunfold _ _  = error "gunfold"
98  dataTypeOf _ = mkNorepType "DataCon"
99
100INSTANCE_TYPEABLE0(Var,varTc,"Var")
101instance Data Var where
102  toConstr _   = abstractConstr "Var"
103  gunfold _ _  = error "gunfold"
104  dataTypeOf _ = mkNorepType "Var"
105
106deriving instance Typeable InlineSpec
107deriving instance Data InlineSpec
108
109deriving instance Typeable ForeignImport
110deriving instance Data ForeignImport
111
112deriving instance Typeable ForeignExport
113deriving instance Data ForeignExport
114
115deriving instance Typeable CImportSpec
116deriving instance Data CImportSpec
117
118deriving instance Typeable CExportSpec
119deriving instance Data CExportSpec
120
121deriving instance Typeable DNCallSpec
122deriving instance Data DNCallSpec
123
124deriving instance Typeable Safety
125deriving instance Data Safety
126
127deriving instance Typeable CCallConv
128deriving instance Data CCallConv
129
130deriving instance Typeable DNKind
131deriving instance Data DNKind
132
133deriving instance Typeable DNType
134deriving instance Data DNType
135
136deriving instance Typeable CCallTarget
137deriving instance Data CCallTarget
138
139deriving instance Typeable Activation
140deriving instance Data Activation
141
142INSTANCE_TYPEABLE0(NameSet,nameSetTc,"NameSet")
143instance Data NameSet where
144  toConstr _   = abstractConstr "NameSet"
145  gunfold _ _  = error "gunfold"
146  dataTypeOf _ = mkNorepType "NameSet"
147
148deriving instance Typeable FoType
149deriving instance Data FoType
150
151deriving instance Typeable FamilyFlavour
152deriving instance Data FamilyFlavour
153
154deriving instance Typeable NewOrData
155deriving instance Data NewOrData
156
157INSTANCE_TYPEABLE0(TyCon.TyCon,tyConTc,"TyCon")
158instance Data TyCon.TyCon where
159  toConstr _   = abstractConstr "TyCon.TyCon"
160  gunfold _ _  = error "gunfold"
161  dataTypeOf _ = mkNorepType "TyCon.TyCon"
162
163INSTANCE_TYPEABLE0(Class,classTc,"Class")
164instance Data Class where
165  toConstr _   = abstractConstr "Class"
166  gunfold _ _  = error "gunfold"
167  dataTypeOf _ = mkNorepType "Class"
168
169