/
Tuple.hs
570 lines (471 loc) · 17.1 KB
/
Tuple.hs
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
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverlappingInstances #-}
{-# OPTIONS -fno-warn-orphans #-}
-----------------------------------------------------------------------------
-- |
-- Module : Generics.EMGM.Data.Tuple
-- Copyright : (c) 2008, 2009 Universiteit Utrecht
-- License : BSD3
--
-- Maintainer : generics@haskell.org
-- Stability : experimental
-- Portability : non-portable
--
-- Summary: Generic representation and instances for tuples of arity 0
-- (''unit'') and 2 to 7.
-----------------------------------------------------------------------------
module Generics.EMGM.Data.Tuple (
-- * Unit: @()@
epTuple0,
conTuple0,
repTuple0,
frepTuple0,
frep2Tuple0,
frep3Tuple0,
bifrep2Tuple0,
-- * Pair: @(a,b)@
epTuple2,
conTuple2,
repTuple2,
frepTuple2,
frep2Tuple2,
frep3Tuple2,
bifrep2Tuple2,
-- * Triple: @(a,b,c)@
epTuple3,
conTuple3,
repTuple3,
frepTuple3,
frep2Tuple3,
frep3Tuple3,
bifrep2Tuple3,
-- * Quadruple: @(a,b,c,d)@
epTuple4,
conTuple4,
repTuple4,
frepTuple4,
frep2Tuple4,
frep3Tuple4,
bifrep2Tuple4,
-- * Quintuple: @(a,b,c,d,e)@
epTuple5,
conTuple5,
repTuple5,
frepTuple5,
frep2Tuple5,
frep3Tuple5,
bifrep2Tuple5,
-- * Sextuple: @(a,b,c,d,e,f)@
epTuple6,
conTuple6,
repTuple6,
frepTuple6,
frep2Tuple6,
frep3Tuple6,
bifrep2Tuple6,
-- * Septuple: @(a,b,c,d,e,f,h)@
epTuple7,
conTuple7,
repTuple7,
frepTuple7,
frep2Tuple7,
frep3Tuple7,
bifrep2Tuple7,
) where
import Generics.EMGM.Common
import Generics.EMGM.Functions.Collect
import Generics.EMGM.Functions.Everywhere
-----------------------------------------------------------------------------
-- 0: ()
-----------------------------------------------------------------------------
-- | Embedding-projection pair for @()@.
epTuple0 :: EP () Unit
epTuple0 = EP (\() -> Unit)
(\Unit -> ())
-- | Constructor description for @()@.
conTuple0 :: ConDescr
conTuple0 = ConDescr "()" 0 [] Nonfix
-- | Representation of @()@ for 'rep'.
repTuple0 :: (Generic g) => g ()
repTuple0 =
rtype
epTuple0
(rcon conTuple0 runit)
-- | Representation of @()@ for 'frep'.
frepTuple0 :: (Generic g) => g ()
frepTuple0 =
repTuple0
-- | Representation of @()@ for 'frep2'.
frep2Tuple0 :: (Generic2 g) => g () ()
frep2Tuple0 =
rtype2
epTuple0 epTuple0
(rcon2 conTuple0 runit2)
-- | Representation of @()@ for 'bifrep2'.
bifrep2Tuple0 :: (Generic2 g) => g () ()
bifrep2Tuple0 =
frep2Tuple0
-- | Representation of @()@ for 'frep3'.
frep3Tuple0 :: (Generic3 g) => g () () ()
frep3Tuple0 =
rtype3
epTuple0 epTuple0 epTuple0
(rcon3 conTuple0 runit3)
-----------------------------------------------------------------------------
-- 2: (a,b)
-----------------------------------------------------------------------------
-- | Embedding-projection pair for @(,)@.
epTuple2 :: EP (a,b) (a :*: b)
epTuple2 = EP (\(a,b) -> a :*: b)
(\(a :*: b) -> (a,b))
-- | Constructor description for @(,)@.
conTuple2 :: ConDescr
conTuple2 = ConDescr "(,)" 2 [] Nonfix
-- | Representation of @(,)@ for 'frep'.
frepTuple2 :: (Generic g) => g a -> g b -> g (a,b)
frepTuple2 ra rb =
rtype
epTuple2
(rcon conTuple2 (ra `rprod` rb))
-- | Representation of @(,)@ for 'rep'.
repTuple2 :: (Generic g, Rep g a, Rep g b) => g (a,b)
repTuple2 =
frepTuple2 rep rep
-- | Representation of @(,)@ for 'frep2'.
frep2Tuple2 :: (Generic2 g) => g a1 a2 -> g b1 b2 -> g (a1,b1) (a2,b2)
frep2Tuple2 ra rb =
rtype2
epTuple2 epTuple2
(rcon2 conTuple2 (ra `rprod2` rb))
-- | Representation of @(,)@ for 'bifrep2'.
bifrep2Tuple2 :: (Generic2 g) => g a1 a2 -> g b1 b2 -> g (a1,b1) (a2,b2)
bifrep2Tuple2 =
frep2Tuple2
-- | Representation of @(,)@ for 'frep3'.
frep3Tuple2 :: (Generic3 g) => g a1 a2 a3 -> g b1 b2 b3 -> g (a1,b1) (a2,b2) (a3,b3)
frep3Tuple2 ra rb =
rtype3
epTuple2 epTuple2 epTuple2
(rcon3 conTuple2 (ra `rprod3` rb))
-----------------------------------------------------------------------------
-- 3: (a,b,c)
-----------------------------------------------------------------------------
-- | Embedding-projection pair for @(,,)@.
epTuple3 :: EP (a,b,c) (a :*: b :*: c)
epTuple3 = EP (\(a,b,c) -> a :*: b :*: c)
(\(a :*: b :*: c) -> (a,b,c))
-- | Constructor description for @(,,)@.
conTuple3 :: ConDescr
conTuple3 = ConDescr "(,,)" 3 [] Nonfix
-- | Representation of @(,,)@ for 'frep'.
frepTuple3 :: (Generic g) => g a -> g b -> g c -> g (a,b,c)
frepTuple3 ra rb rc =
rtype
epTuple3
(rcon conTuple3 (ra `rprod` rb `rprod` rc))
-- | Representation of @(,,)@ for 'rep'.
repTuple3 :: (Generic g, Rep g a, Rep g b, Rep g c) => g (a,b,c)
repTuple3 =
frepTuple3 rep rep rep
-- | Representation of @(,,)@ for 'frep2'.
frep2Tuple3 :: (Generic2 g) => g a1 a2 -> g b1 b2 -> g c1 c2 -> g (a1,b1,c1) (a2,b2,c2)
frep2Tuple3 ra rb rc =
rtype2
epTuple3 epTuple3
(rcon2 conTuple3 (ra `rprod2` rb `rprod2` rc))
-- | Representation of @(,,)@ for 'bifrep2'.
bifrep2Tuple3 :: (Generic2 g) => g a1 a2 -> g b1 b2 -> g c1 c2 -> g (a1,b1,c1) (a2,b2,c2)
bifrep2Tuple3 =
frep2Tuple3
-- | Representation of @(,,)@ for 'frep3'.
frep3Tuple3 :: (Generic3 g) => g a1 a2 a3 -> g b1 b2 b3 -> g c1 c2 c3 -> g (a1,b1,c1) (a2,b2,c2) (a3,b3,c3)
frep3Tuple3 ra rb rc =
rtype3
epTuple3 epTuple3 epTuple3
(rcon3 conTuple3 (ra `rprod3` rb `rprod3` rc))
-----------------------------------------------------------------------------
-- 4: (a,b,c,d)
-----------------------------------------------------------------------------
-- | Embedding-projection pair for @(,,,)@.
epTuple4 :: EP (a,b,c,d) (a :*: b :*: c :*: d)
epTuple4 = EP (\(a,b,c,d) -> a :*: b :*: c :*: d)
(\(a :*: b :*: c :*: d) -> (a,b,c,d))
-- | Constructor description for @(,,,)@.
conTuple4 :: ConDescr
conTuple4 = ConDescr "(,,,)" 4 [] Nonfix
-- | Representation of @(,,,)@ for 'frep'.
frepTuple4 :: (Generic g) => g a -> g b -> g c -> g d -> g (a,b,c,d)
frepTuple4 ra rb rc rd =
rtype
epTuple4
(rcon conTuple4 (ra `rprod` rb `rprod` rc `rprod` rd))
-- | Representation of @(,,,)@ for 'rep'.
repTuple4 :: (Generic g, Rep g a, Rep g b, Rep g c, Rep g d) => g (a,b,c,d)
repTuple4 =
frepTuple4 rep rep rep rep
-- | Representation of @(,,,)@ for 'frep2'.
frep2Tuple4 :: (Generic2 g) => g a1 a2 -> g b1 b2 -> g c1 c2 -> g d1 d2 -> g (a1,b1,c1,d1) (a2,b2,c2,d2)
frep2Tuple4 ra rb rc rd =
rtype2
epTuple4 epTuple4
(rcon2 conTuple4 (ra `rprod2` rb `rprod2` rc `rprod2` rd))
-- | Representation of @(,,,)@ for 'bifrep2'.
bifrep2Tuple4 :: (Generic2 g) => g a1 a2 -> g b1 b2 -> g c1 c2 -> g d1 d2 -> g (a1,b1,c1,d1) (a2,b2,c2,d2)
bifrep2Tuple4 =
frep2Tuple4
-- | Representation of @(,,,)@ for 'frep3'.
frep3Tuple4 :: (Generic3 g) => g a1 a2 a3 -> g b1 b2 b3 -> g c1 c2 c3 -> g d1 d2 d3 -> g (a1,b1,c1,d1) (a2,b2,c2,d2) (a3,b3,c3,d3)
frep3Tuple4 ra rb rc rd =
rtype3
epTuple4 epTuple4 epTuple4
(rcon3 conTuple4 (ra `rprod3` rb `rprod3` rc `rprod3` rd))
-----------------------------------------------------------------------------
-- 5: (a,b,c,d,e)
-----------------------------------------------------------------------------
-- | Embedding-projection pair for @(,,,,)@.
epTuple5 :: EP (a,b,c,d,e) (a :*: b :*: c :*: d :*: e)
epTuple5 = EP (\(a,b,c,d,e) -> a :*: b :*: c :*: d :*: e)
(\(a :*: b :*: c :*: d :*: e) -> (a,b,c,d,e))
-- | Constructor description for @(,,,,)@.
conTuple5 :: ConDescr
conTuple5 = ConDescr "(,,,,)" 5 [] Nonfix
-- | Representation of @(,,,,)@ for 'frep'.
frepTuple5 :: (Generic g) => g a -> g b -> g c -> g d -> g e -> g (a,b,c,d,e)
frepTuple5 ra rb rc rd re =
rtype
epTuple5
(rcon conTuple5 (ra `rprod` rb `rprod` rc `rprod` rd `rprod` re))
-- | Representation of @(,,,,)@ for 'rep'.
repTuple5 :: (Generic g, Rep g a, Rep g b, Rep g c, Rep g d, Rep g e) => g (a,b,c,d,e)
repTuple5 =
frepTuple5 rep rep rep rep rep
-- | Representation of @(,,,,)@ for 'frep2'.
frep2Tuple5 :: (Generic2 g) => g a1 a2 -> g b1 b2 -> g c1 c2 -> g d1 d2 -> g e1 e2 -> g (a1,b1,c1,d1,e1) (a2,b2,c2,d2,e2)
frep2Tuple5 ra rb rc rd re =
rtype2
epTuple5 epTuple5
(rcon2 conTuple5 (ra `rprod2` rb `rprod2` rc `rprod2` rd `rprod2` re))
-- | Representation of @(,,,,)@ for 'bfrep2'.
bifrep2Tuple5 :: (Generic2 g) => g a1 a2 -> g b1 b2 -> g c1 c2 -> g d1 d2 -> g e1 e2 -> g (a1,b1,c1,d1,e1) (a2,b2,c2,d2,e2)
bifrep2Tuple5 =
frep2Tuple5
-- | Representation of @(,,,,)@ for 'frep3'.
frep3Tuple5 :: (Generic3 g) => g a1 a2 a3 -> g b1 b2 b3 -> g c1 c2 c3 -> g d1 d2 d3 -> g e1 e2 e3 -> g (a1,b1,c1,d1,e1) (a2,b2,c2,d2,e2) (a3,b3,c3,d3,e3)
frep3Tuple5 ra rb rc rd re =
rtype3
epTuple5 epTuple5 epTuple5
(rcon3 conTuple5 (ra `rprod3` rb `rprod3` rc `rprod3` rd `rprod3` re))
-----------------------------------------------------------------------------
-- 6: (a,b,c,d,e,f)
-----------------------------------------------------------------------------
-- | Embedding-projection pair for @(,,,,,)@.
epTuple6 :: EP (a,b,c,d,e,f) (a :*: b :*: c :*: d :*: e :*: f)
epTuple6 = EP (\(a,b,c,d,e,f) -> a :*: b :*: c :*: d :*: e :*: f)
(\(a :*: b :*: c :*: d :*: e :*: f) -> (a,b,c,d,e,f))
-- | Constructor description for @(,,,,,)@.
conTuple6 :: ConDescr
conTuple6 = ConDescr "(,,,,,)" 6 [] Nonfix
-- | Representation of @(,,,,,)@ for 'frep'.
frepTuple6 :: (Generic g) => g a -> g b -> g c -> g d -> g e -> g f -> g (a,b,c,d,e,f)
frepTuple6 ra rb rc rd re rf =
rtype
epTuple6
(rcon conTuple6 (ra `rprod` rb `rprod` rc `rprod` rd `rprod` re `rprod` rf))
-- | Representation of @(,,,,,)@ for 'rep'.
repTuple6 :: (Generic g, Rep g a, Rep g b, Rep g c, Rep g d, Rep g e, Rep g f) => g (a,b,c,d,e,f)
repTuple6 =
frepTuple6 rep rep rep rep rep rep
-- | Representation of @(,,,,,)@ for 'frep2'.
frep2Tuple6 :: (Generic2 g) => g a1 a2 -> g b1 b2 -> g c1 c2 -> g d1 d2 -> g e1 e2 -> g f1 f2 -> g (a1,b1,c1,d1,e1,f1) (a2,b2,c2,d2,e2,f2)
frep2Tuple6 ra rb rc rd re rf =
rtype2
epTuple6 epTuple6
(rcon2 conTuple6 (ra `rprod2` rb `rprod2` rc `rprod2` rd `rprod2` re `rprod2` rf))
-- | Representation of @(,,,,,)@ for 'bifrep2'.
bifrep2Tuple6 :: (Generic2 g) => g a1 a2 -> g b1 b2 -> g c1 c2 -> g d1 d2 -> g e1 e2 -> g f1 f2 -> g (a1,b1,c1,d1,e1,f1) (a2,b2,c2,d2,e2,f2)
bifrep2Tuple6 =
frep2Tuple6
-- | Representation of @(,,,,,)@ for 'frep3'.
frep3Tuple6 :: (Generic3 g) => g a1 a2 a3 -> g b1 b2 b3 -> g c1 c2 c3 -> g d1 d2 d3 -> g e1 e2 e3 -> g f1 f2 f3 -> g (a1,b1,c1,d1,e1,f1) (a2,b2,c2,d2,e2,f2) (a3,b3,c3,d3,e3,f3)
frep3Tuple6 ra rb rc rd re rf =
rtype3
epTuple6 epTuple6 epTuple6
(rcon3 conTuple6 (ra `rprod3` rb `rprod3` rc `rprod3` rd `rprod3` re `rprod3` rf))
-----------------------------------------------------------------------------
-- 7: (a,b,c,d,e,f,h)
-----------------------------------------------------------------------------
-- | Embedding-projection pair for @(,,,,,,)@.
epTuple7 :: EP (a,b,c,d,e,f,h) (a :*: b :*: c :*: d :*: e :*: f :*: h)
epTuple7 = EP (\(a,b,c,d,e,f,h) -> a :*: b :*: c :*: d :*: e :*: f :*: h)
(\(a :*: b :*: c :*: d :*: e :*: f :*: h) -> (a,b,c,d,e,f,h))
-- | Constructor description for @(,,,,,,)@.
conTuple7 :: ConDescr
conTuple7 = ConDescr "(,,,,,)" 7 [] Nonfix
-- | Representation of @(,,,,,,)@ for 'frep'.
frepTuple7 :: (Generic g) => g a -> g b -> g c -> g d -> g e -> g f -> g h -> g (a,b,c,d,e,f,h)
frepTuple7 ra rb rc rd re rf rh =
rtype
epTuple7
(rcon conTuple7 (ra `rprod` rb `rprod` rc `rprod` rd `rprod` re `rprod` rf `rprod` rh))
-- | Representation of @(,,,,,,)@ for 'rep'.
repTuple7 :: (Generic g, Rep g a, Rep g b, Rep g c, Rep g d, Rep g e, Rep g f, Rep g h) => g (a,b,c,d,e,f,h)
repTuple7 =
frepTuple7 rep rep rep rep rep rep rep
-- | Representation of @(,,,,,,)@ for 'frep2'.
frep2Tuple7 :: (Generic2 g) => g a1 a2 -> g b1 b2 -> g c1 c2 -> g d1 d2 -> g e1 e2 -> g f1 f2 -> g h1 h2 -> g (a1,b1,c1,d1,e1,f1,h1) (a2,b2,c2,d2,e2,f2,h2)
frep2Tuple7 ra rb rc rd re rf rh =
rtype2
epTuple7 epTuple7
(rcon2 conTuple7 (ra `rprod2` rb `rprod2` rc `rprod2` rd `rprod2` re `rprod2` rf `rprod2` rh))
-- | Representation of @(,,,,,,)@ for 'bifrep2'.
bifrep2Tuple7 :: (Generic2 g) => g a1 a2 -> g b1 b2 -> g c1 c2 -> g d1 d2 -> g e1 e2 -> g f1 f2 -> g h1 h2 -> g (a1,b1,c1,d1,e1,f1,h1) (a2,b2,c2,d2,e2,f2,h2)
bifrep2Tuple7 =
frep2Tuple7
-- | Representation of @(,,,,,,)@ for 'frep3'.
frep3Tuple7 :: (Generic3 g) => g a1 a2 a3 -> g b1 b2 b3 -> g c1 c2 c3 -> g d1 d2 d3 -> g e1 e2 e3 -> g f1 f2 f3 -> g h1 h2 h3 -> g (a1,b1,c1,d1,e1,f1,h1) (a2,b2,c2,d2,e2,f2,h2) (a3,b3,c3,d3,e3,f3,h3)
frep3Tuple7 ra rb rc rd re rf rh =
rtype3
epTuple7 epTuple7 epTuple7
(rcon3 conTuple7 (ra `rprod3` rb `rprod3` rc `rprod3` rd `rprod3` re `rprod3` rf `rprod3` rh))
-----------------------------------------------------------------------------
-- Instance declarations
-----------------------------------------------------------------------------
instance (Generic g) => Rep g () where
rep = repTuple0
instance (Generic g, Rep g a, Rep g b) => Rep g (a,b) where
rep = repTuple2
instance (Generic g, Rep g a, Rep g b, Rep g c) => Rep g (a,b,c) where
rep = repTuple3
instance (Generic g, Rep g a, Rep g b, Rep g c, Rep g d) => Rep g (a,b,c,d) where
rep = repTuple4
instance (Generic g, Rep g a, Rep g b, Rep g c, Rep g d, Rep g e) => Rep g (a,b,c,d,e) where
rep = repTuple5
instance (Generic g, Rep g a, Rep g b, Rep g c, Rep g d, Rep g e, Rep g f) => Rep g (a,b,c,d,e,f) where
rep = repTuple6
instance (Generic g, Rep g a, Rep g b, Rep g c, Rep g d, Rep g e, Rep g f, Rep g h) => Rep g (a,b,c,d,e,f,h) where
rep = repTuple7
instance (Generic2 g) => BiFRep2 g (,) where
bifrep2 = frep2Tuple2
instance Rep (Collect ()) () where
rep = Collect (:[])
instance Rep (Collect (a,b)) (a,b) where
rep = Collect (:[])
instance Rep (Collect (a,b,c)) (a,b,c) where
rep = Collect (:[])
instance Rep (Collect (a,b,c,d)) (a,b,c,d) where
rep = Collect (:[])
instance Rep (Collect (a,b,c,d,e)) (a,b,c,d,e) where
rep = Collect (:[])
instance Rep (Collect (a,b,c,d,e,f)) (a,b,c,d,e,f) where
rep = Collect (:[])
instance Rep (Collect (a,b,c,d,e,f,h)) (a,b,c,d,e,f,h) where
rep = Collect (:[])
instance Rep (Everywhere' ()) () where
rep = Everywhere' ($)
instance Rep (Everywhere' (a,b)) (a,b) where
rep = Everywhere' ($)
instance Rep (Everywhere' (a,b,c)) (a,b,c) where
rep = Everywhere' ($)
instance Rep (Everywhere' (a,b,c,d)) (a,b,c,d) where
rep = Everywhere' ($)
instance Rep (Everywhere' (a,b,c,d,e)) (a,b,c,d,e) where
rep = Everywhere' ($)
instance Rep (Everywhere' (a,b,c,d,e,f)) (a,b,c,d,e,f) where
rep = Everywhere' ($)
instance Rep (Everywhere' (a,b,c,d,e,f,h)) (a,b,c,d,e,f,h) where
rep = Everywhere' ($)
instance Rep (Everywhere ()) () where
rep = Everywhere ($)
instance
( Rep (Everywhere (a,b)) a
, Rep (Everywhere (a,b)) b
) => Rep (Everywhere (a,b)) (a,b) where
rep = Everywhere
(\z (a,b) -> z
( selEverywhere rep z a
, selEverywhere rep z b
)
)
instance
( Rep (Everywhere (a,b,c)) a
, Rep (Everywhere (a,b,c)) b
, Rep (Everywhere (a,b,c)) c
) => Rep (Everywhere (a,b,c)) (a,b,c) where
rep = Everywhere
(\z (a,b,c) -> z
( selEverywhere rep z a
, selEverywhere rep z b
, selEverywhere rep z c
)
)
instance
( Rep (Everywhere (a,b,c,d)) a
, Rep (Everywhere (a,b,c,d)) b
, Rep (Everywhere (a,b,c,d)) c
, Rep (Everywhere (a,b,c,d)) d
) => Rep (Everywhere (a,b,c,d)) (a,b,c,d) where
rep = Everywhere
(\z (a,b,c,d) -> z
( selEverywhere rep z a
, selEverywhere rep z b
, selEverywhere rep z c
, selEverywhere rep z d
)
)
instance
( Rep (Everywhere (a,b,c,d,e)) a
, Rep (Everywhere (a,b,c,d,e)) b
, Rep (Everywhere (a,b,c,d,e)) c
, Rep (Everywhere (a,b,c,d,e)) d
, Rep (Everywhere (a,b,c,d,e)) e
) => Rep (Everywhere (a,b,c,d,e)) (a,b,c,d,e) where
rep = Everywhere
(\z (a,b,c,d,e) -> z
( selEverywhere rep z a
, selEverywhere rep z b
, selEverywhere rep z c
, selEverywhere rep z d
, selEverywhere rep z e
)
)
instance
( Rep (Everywhere (a,b,c,d,e,f)) a
, Rep (Everywhere (a,b,c,d,e,f)) b
, Rep (Everywhere (a,b,c,d,e,f)) c
, Rep (Everywhere (a,b,c,d,e,f)) d
, Rep (Everywhere (a,b,c,d,e,f)) e
, Rep (Everywhere (a,b,c,d,e,f)) f
) => Rep (Everywhere (a,b,c,d,e,f)) (a,b,c,d,e,f) where
rep = Everywhere
(\z (a,b,c,d,e,f) -> z
( selEverywhere rep z a
, selEverywhere rep z b
, selEverywhere rep z c
, selEverywhere rep z d
, selEverywhere rep z e
, selEverywhere rep z f
)
)
instance
( Rep (Everywhere (a,b,c,d,e,f,h)) a
, Rep (Everywhere (a,b,c,d,e,f,h)) b
, Rep (Everywhere (a,b,c,d,e,f,h)) c
, Rep (Everywhere (a,b,c,d,e,f,h)) d
, Rep (Everywhere (a,b,c,d,e,f,h)) e
, Rep (Everywhere (a,b,c,d,e,f,h)) f
, Rep (Everywhere (a,b,c,d,e,f,h)) h
) => Rep (Everywhere (a,b,c,d,e,f,h)) (a,b,c,d,e,f,h) where
rep = Everywhere
(\z (a,b,c,d,e,f,h) -> z
( selEverywhere rep z a
, selEverywhere rep z b
, selEverywhere rep z c
, selEverywhere rep z d
, selEverywhere rep z e
, selEverywhere rep z f
, selEverywhere rep z h
)
)