-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathghc-tcplugin-api.cabal
More file actions
182 lines (151 loc) · 5.11 KB
/
ghc-tcplugin-api.cabal
File metadata and controls
182 lines (151 loc) · 5.11 KB
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
cabal-version: 3.0
name: ghc-tcplugin-api
version: 0.18.2.1
synopsis: An API for type-checker plugins.
license: BSD-3-Clause
build-type: Simple
author: Sam Derbyshire
maintainer: Sam Derbyshire
copyright: 2021-2025 Sam Derbyshire
homepage: https://github.com/sheaf/ghc-tcplugin-api
category: Type System, GHC, Plugin
description:
This library provides a streamlined monadic interface
for writing GHC type-checking plugins.
Each stage in a type-checking plugin (initialisation, solving, rewriting,
shutdown) has a corresponding monad, preventing operations that are only
allowed in some stages to be used in the other stages.
Operations that work across multiple stages are overloaded across monads
using MTL-like typeclasses.
Some operations, like creating evidence for constraints or creating
custom type error messages, are also simplified.
Please refer to the <https://github.com/sheaf/ghc-tcplugin-api associated GitHub repository>
for example usage.
extra-source-files:
changelog.md
library
build-depends:
base
>= 4.13.0 && < 5,
array
>= 0.5.3.0 && < 0.6,
containers
>= 0.6 && < 0.9,
ghc
>= 8.8 && < 10.1,
transformers
>= 0.5 && < 0.7,
template-haskell
>= 2.15 && < 2.26,
default-language:
Haskell2010
ghc-options:
-Wall
-Wcompat
-fwarn-missing-local-signatures
-fwarn-incomplete-uni-patterns
-fwarn-missing-deriving-strategies
-fno-warn-unticked-promoted-constructors
hs-source-dirs:
src
exposed-modules:
GHC.TcPlugin.API,
GHC.TcPlugin.API.Names,
GHC.TcPlugin.API.TyConSubst,
GHC.TcPlugin.API.Internal
reexported-modules:
GHC.Builtin.Names
, GHC.Builtin.Types
, GHC.Builtin.Types.Prim
, GHC.Core.Make
, GHC.Plugins
, GHC.Types.Unique.DFM
, GHC.Types.Unique.FM
, GHC.Types.Unique.Set
, GHC.Types.Unique.DSet
, GHC.Utils.Outputable
if impl(ghc >= 9.13.0)
-- Don't warn on exports of the form "pattern ClassPred".
-- We can migrate to using "data" when that becomes necessary.
ghc-options: -Wno-pattern-namespace-specifier
if impl(ghc >= 9.3.0)
cpp-options: -DHAS_REWRITING
else
cpp-options: -DHAS_DERIVEDS
other-modules:
GHC.TcPlugin.API.Internal.Shim
GHC.TcPlugin.API.Internal.Shim.Reduction
-- Compatibility for versions of GHC prior to 9.0.
if impl(ghc < 9.0)
mixins:
ghc
( GHC as GHC
, PrelNames as GHC.Builtin.Names
, TysWiredIn as GHC.Builtin.Types
, TysPrim as GHC.Builtin.Types.Prim
, CoreSyn as GHC.Core
, CoAxiom as GHC.Core.Coercion.Axiom
, Coercion as GHC.Core.Coercion
, Class as GHC.Core.Class
, DataCon as GHC.Core.DataCon
, FamInstEnv as GHC.Core.FamInstEnv
, InstEnv as GHC.Core.InstEnv
, MkCore as GHC.Core.Make
, TyCoRep as GHC.Core.TyCo.Rep
, TyCon as GHC.Core.TyCon
, Type as GHC.Core.Type
, FastString as GHC.Data.FastString
, Pair as GHC.Data.Pair
, Finder as GHC.Driver.Finder
, DynFlags as GHC.Driver.Session
, HscTypes as GHC.Driver.Types
, IfaceEnv as GHC.Iface.Env
, GhcPlugins as GHC.Plugins
, TcPluginM as GHC.Tc.Plugin
, TcSMonad as GHC.Tc.Solver.Monad
, TcRnTypes as GHC.Tc.Types
, TcEvidence as GHC.Tc.Types.Evidence
, TcRnMonad as GHC.Tc.Utils.Monad
, TcType as GHC.Tc.Utils.TcType
, TcMType as GHC.Tc.Utils.TcMType
, BasicTypes as GHC.Types.Basic
, Id as GHC.Types.Id
, Literal as GHC.Types.Literal
, Name as GHC.Types.Name
, OccName as GHC.Types.Name.Occurrence
, RdrName as GHC.Types.Name.Reader
, SrcLoc as GHC.Types.SrcLoc
, Unique as GHC.Types.Unique
, UniqDFM as GHC.Types.Unique.DFM
, UniqDSet as GHC.Types.Unique.DSet
, UniqFM as GHC.Types.Unique.FM
, UniqSet as GHC.Types.Unique.Set
, Var as GHC.Types.Var
, VarEnv as GHC.Types.Var.Env
, VarSet as GHC.Types.Var.Set
, Module as GHC.Unit.Module
, Module as GHC.Unit.Module.Name
, Module as GHC.Unit.Types
, FV as GHC.Utils.FV
, Util as GHC.Utils.Misc
, TcRnMonad as GHC.Utils.Monad
, Outputable as GHC.Utils.Outputable
, Panic as GHC.Utils.Panic
)
if impl(ghc > 8.10)
mixins:
ghc
( Predicate as GHC.Core.Predicate
, Constraint as GHC.Tc.Types.Constraint
, TcOrigin as GHC.Tc.Types.Origin
, GHC.ThToHs as GHC.ThToHs
-- I forget what this last line does, but it is needed on GHC 9.10
)
else
mixins:
ghc
( Type as GHC.Core.Predicate
, TcRnTypes as GHC.Tc.Types.Constraint
, TcRnTypes as GHC.Tc.Types.Origin
, Convert as GHC.ThToHs
)