@@ -394,30 +394,30 @@ instance {-# OVERLAPS #-} (GFromSchemaFieldTypeUnion sch (a ': b ': rest) v)
394
394
=> GFromSchemaFieldTypeUnion sch (a ': b ': rest ) (M1 i t v ) where
395
395
fromSchemaFieldTypeUnion x = M1 (fromSchemaFieldTypeUnion x)
396
396
397
- instance (GToSchemaFieldTypeWrap sch t v , GToSchemaFieldTypeUnion sch ts vs )
397
+ instance {-# OVERLAPPABLE #-} (GToSchemaFieldTypeWrap sch t v , GToSchemaFieldTypeUnion sch ts vs )
398
398
=> GToSchemaFieldTypeUnion sch (t ': ts ) (v :+: vs ) where
399
399
toSchemaFieldTypeUnion (L1 x) = Z (toSchemaFieldTypeW x)
400
400
toSchemaFieldTypeUnion (R1 r) = S (toSchemaFieldTypeUnion r)
401
- instance (GFromSchemaFieldTypeWrap sch t v , GFromSchemaFieldTypeUnion sch ts vs )
401
+ instance {-# OVERLAPPABLE #-} (GFromSchemaFieldTypeWrap sch t v , GFromSchemaFieldTypeUnion sch ts vs )
402
402
=> GFromSchemaFieldTypeUnion sch (t ': ts ) (v :+: vs ) where
403
403
fromSchemaFieldTypeUnion (Z x) = L1 (fromSchemaFieldTypeW x)
404
404
fromSchemaFieldTypeUnion (S r) = R1 (fromSchemaFieldTypeUnion r)
405
405
-- Weird nested instance produced by GHC
406
- instance ( GToSchemaFieldTypeWrap sch t1 v1
407
- , GToSchemaFieldTypeWrap sch t2 v2
408
- , GToSchemaFieldTypeUnion sch ts vs )
409
- => GToSchemaFieldTypeUnion sch ( t1 ': t2 ' : ts ) (( v1 :+: v2 ) :+: vs ) where
410
- toSchemaFieldTypeUnion (L1 (L1 x)) = Z (toSchemaFieldTypeW x )
411
- toSchemaFieldTypeUnion ( L1 ( R1 x)) = S ( Z (toSchemaFieldTypeW x))
412
- toSchemaFieldTypeUnion (R1 r) = S ( S (toSchemaFieldTypeUnion r))
413
- instance ( GFromSchemaFieldTypeWrap sch t1 v1
414
- , GFromSchemaFieldTypeWrap sch t2 v2
415
- , GFromSchemaFieldTypeUnion sch ts vs )
416
- => GFromSchemaFieldTypeUnion sch ( t1 ' : t2 ' : ts ) (( v1 :+: v2 ) :+: vs ) where
417
- fromSchemaFieldTypeUnion ( Z x) = L1 ( L1 (fromSchemaFieldTypeW x))
418
- fromSchemaFieldTypeUnion ( S ( Z x)) = L1 (R1 (fromSchemaFieldTypeW x) )
419
- fromSchemaFieldTypeUnion ( S ( S r)) = R1 (fromSchemaFieldTypeUnion r )
420
-
406
+ instance {-# OVERLAPS #-} ( GToSchemaFieldTypeUnion sch ( t ' : ts ) ( v1 :+: ( v2 :+: vs )) )
407
+ => GToSchemaFieldTypeUnion sch ( t ' : ts ) (( v1 :+: v2 ) :+: vs ) where
408
+ toSchemaFieldTypeUnion ( L1 ( L1 x) )
409
+ = toSchemaFieldTypeUnion @ _ @ _ @ sch @ ( t ': ts ) @ ( v1 :+: ( v2 :+: vs )) ( L1 x)
410
+ toSchemaFieldTypeUnion (L1 (R1 x))
411
+ = toSchemaFieldTypeUnion @ _ @ _ @ sch @ ( t ' : ts ) @ ( v1 :+: ( v2 :+: vs )) ( R1 ( L1 x))
412
+ toSchemaFieldTypeUnion (R1 r)
413
+ = toSchemaFieldTypeUnion @ _ @ _ @ sch @ ( t ' : ts ) @ ( v1 :+: ( v2 :+: vs )) ( R1 ( R1 r))
414
+ instance {-# OVERLAPS #-} ( GFromSchemaFieldTypeUnion sch ( t ' : ts ) ( v1 :+: ( v2 :+: vs )) )
415
+ => GFromSchemaFieldTypeUnion sch ( t ' : ts ) (( v1 :+: v2 ) :+: vs ) where
416
+ fromSchemaFieldTypeUnion t
417
+ = case fromSchemaFieldTypeUnion @ _ @ _ @ sch @ ( t ' : ts ) @ ( v1 :+: ( v2 :+: vs )) t of
418
+ L1 x -> L1 (L1 x )
419
+ R1 ( L1 x) -> L1 ( R1 x )
420
+ R1 ( R1 x) -> R1 x
421
421
422
422
-- ---------------
423
423
-- ENUMERATIONS --
0 commit comments