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
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
|
==================== Common sub-expression ====================
Result size of Common sub-expression
= {terms: 181, types: 89, coercions: 5, joins: 0/1}
-- RHS size: {terms: 5, types: 10, coercions: 0, joins: 0/0}
$cmyfmap_aG7
:: forall a b. (Domain [] a, Domain [] b) => (a -> b) -> [a] -> [b]
[LclId,
Arity=4,
Str=<A><A><U><SU>,
Unf=Unf{Src=InlineStable, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True,
Guidance=ALWAYS_IF(arity=2,unsat_ok=True,boring_ok=True)
Tmpl= \ (@a_aGa)
(@b_aGb)
_ [Occ=Dead]
_ [Occ=Dead]
(eta_B0 [Occ=Once1, OS=OneShot] :: a_aGa -> b_aGb)
(eta_B1 [Occ=Once1, OS=OneShot] :: [a_aGa]) ->
GHC.Base.build
@b_aGb
(\ (@b1_aHe)
(c_aHf [Occ=Once1, OS=OneShot] :: b_aGb -> b1_aHe -> b1_aHe)
(n_aHg [Occ=Once1, OS=OneShot] :: b1_aHe) ->
GHC.Base.foldr
@a_aGa
@b1_aHe
(GHC.Base.mapFB @b_aGb @b1_aHe @a_aGa c_aHf eta_B0)
n_aHg
eta_B1)}]
$cmyfmap_aG7
= \ (@a_aGa)
(@b_aGb)
_ [Occ=Dead, Dmd=A]
_ [Occ=Dead, Dmd=A, OS=OneShot] ->
map @a_aGa @b_aGb
-- RHS size: {terms: 1, types: 0, coercions: 3, joins: 0/0}
Foo.$fMyFunctor[] [InlPrag=INLINE (sat-args=0)] :: MyFunctor []
[LclIdX[DFunId(nt)],
Arity=4,
Str=<A><A><U><SU>,
Unf=Unf{Src=InlineStable, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True,
Guidance=ALWAYS_IF(arity=0,unsat_ok=False,boring_ok=True)
Tmpl= $cmyfmap_aG7
`cast` (Sym (Foo.N:MyFunctor[0] <[]>_N)
:: (forall a b.
(Domain [] a, Domain [] b) =>
(a -> b) -> [a] -> [b])
~R# MyFunctor [])}]
Foo.$fMyFunctor[]
= $cmyfmap_aG7
`cast` (Sym (Foo.N:MyFunctor[0] <[]>_N)
:: (forall a b.
(Domain [] a, Domain [] b) =>
(a -> b) -> [a] -> [b])
~R# MyFunctor [])
-- RHS size: {terms: 2, types: 2, coercions: 0, joins: 0/0}
$sshared_sHD :: [Int] -> [Int]
[LclId,
Arity=1,
Str=<SU>,
Unf=Unf{Src=InlineStable, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True,
Guidance=ALWAYS_IF(arity=0,unsat_ok=True,boring_ok=False)
Tmpl= map @Int @Int GHC.Num.$fNumInt_$cnegate}]
$sshared_sHD = map @Int @Int GHC.Num.$fNumInt_$cnegate
-- RHS size: {terms: 115, types: 15, coercions: 2, joins: 0/1}
shared
:: forall (f :: * -> *).
(MyFunctor f, Domain f Int) =>
f Int -> f Int
[LclIdX,
Arity=2,
Str=<UC1(CS(CS(U)))><U>,
RULES: "SPEC shared @[]"
forall ($dMyFunctor_sHz :: MyFunctor [])
(irred_sHA :: Domain [] Int).
shared @[] $dMyFunctor_sHz irred_sHA
= $sshared_sHD]
shared
= \ (@(f_ayh :: * -> *))
($dMyFunctor_ayi [Dmd=UC1(CS(CS(U)))] :: MyFunctor f_ayh)
(irred_ayj :: Domain f_ayh Int) ->
let {
f_sHy :: f_ayh Int -> f_ayh Int
[LclId]
f_sHy
= ($dMyFunctor_ayi
`cast` (Foo.N:MyFunctor[0] <f_ayh>_N
:: MyFunctor f_ayh
~R# (forall a b.
(Domain f_ayh a, Domain f_ayh b) =>
(a -> b) -> f_ayh a -> f_ayh b)))
@Int @Int irred_ayj irred_ayj GHC.Num.$fNumInt_$cnegate } in
\ (x_X4N :: f_ayh Int) ->
f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
(f_sHy
x_X4N))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
lvl_sHI :: Int
[LclId]
lvl_sHI = GHC.Types.I# 0#
-- RHS size: {terms: 6, types: 5, coercions: 0, joins: 0/0}
foo :: [Int] -> [Int]
[LclIdX,
Arity=1,
Str=<U>,
Unf=Unf{Src=InlineStable, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True,
Guidance=ALWAYS_IF(arity=1,unsat_ok=True,boring_ok=False)
Tmpl= \ (xs_awV [Occ=Once1] :: [Int]) ->
GHC.Base.build
@Int
(\ (@b1_aHe)
(c_aHf [Occ=Once1, OS=OneShot] :: Int -> b1_aHe -> b1_aHe)
(n_aHg [Occ=Once1, OS=OneShot] :: b1_aHe) ->
GHC.Base.foldr
@Int
@b1_aHe
(GHC.Base.mapFB @Int @b1_aHe @Int c_aHf GHC.Num.$fNumInt_$cnegate)
n_aHg
(GHC.Types.: @Int lvl_sHI xs_awV))}]
foo
= \ (xs_awV :: [Int]) ->
map
@Int
@Int
GHC.Num.$fNumInt_$cnegate
(GHC.Types.: @Int lvl_sHI xs_awV)
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
lvl_sHJ :: Int
[LclId]
lvl_sHJ = lvl_sHI
-- RHS size: {terms: 6, types: 5, coercions: 0, joins: 0/0}
bar :: [Int] -> [Int]
[LclIdX,
Arity=1,
Str=<1U>,
Cpr=m2,
Unf=Unf{Src=InlineStable, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True,
Guidance=ALWAYS_IF(arity=1,unsat_ok=True,boring_ok=False)
Tmpl= \ (xs_awW [Occ=Once1] :: [Int]) ->
GHC.Types.:
@Int
lvl_sHI
(GHC.Base.build
@Int
(\ (@b1_aHe)
(c_aHf [Occ=Once1, OS=OneShot] :: Int -> b1_aHe -> b1_aHe)
(n_aHg [Occ=Once1, OS=OneShot] :: b1_aHe) ->
GHC.Base.foldr
@Int
@b1_aHe
(GHC.Base.mapFB @Int @b1_aHe @Int c_aHf GHC.Num.$fNumInt_$cnegate)
n_aHg
xs_awW))}]
bar
= \ (xs_awW :: [Int]) ->
GHC.Types.:
@Int lvl_sHI (map @Int @Int GHC.Num.$fNumInt_$cnegate xs_awW)
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
$trModule_sHr :: GHC.Prim.Addr#
[LclId]
$trModule_sHr = "main"#
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
$trModule_sHs :: GHC.Types.TrName
[LclId]
$trModule_sHs = GHC.Types.TrNameS $trModule_sHr
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
$trModule_sHt :: GHC.Prim.Addr#
[LclId]
$trModule_sHt = "Foo"#
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
$trModule_sHu :: GHC.Types.TrName
[LclId]
$trModule_sHu = GHC.Types.TrNameS $trModule_sHt
-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
Foo.$trModule :: GHC.Types.Module
[LclIdX]
Foo.$trModule = GHC.Types.Module $trModule_sHs $trModule_sHu
-- RHS size: {terms: 3, types: 1, coercions: 0, joins: 0/0}
$krep_aGF [InlPrag=[~]] :: GHC.Types.KindRep
[LclId]
$krep_aGF
= GHC.Types.KindRepTyConApp
GHC.Types.$tcConstraint (GHC.Types.[] @GHC.Types.KindRep)
-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
$krep_aGE [InlPrag=[~]] :: GHC.Types.KindRep
[LclId]
$krep_aGE = GHC.Types.KindRepFun GHC.Types.krep$*Arr* $krep_aGF
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
$tcMyFunctor_sHv :: GHC.Prim.Addr#
[LclId]
$tcMyFunctor_sHv = "MyFunctor"#
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
$tcMyFunctor_sHw :: GHC.Types.TrName
[LclId]
$tcMyFunctor_sHw = GHC.Types.TrNameS $tcMyFunctor_sHv
-- RHS size: {terms: 7, types: 0, coercions: 0, joins: 0/0}
Foo.$tcMyFunctor :: GHC.Types.TyCon
[LclIdX]
Foo.$tcMyFunctor
= GHC.Types.TyCon
12837160846121910345##
787075802864859973##
Foo.$trModule
$tcMyFunctor_sHw
0#
$krep_aGE
|