@@ -57,15 +57,18 @@ class GSplash (sub :: Type -> Type) (sup :: Type -> Type) where
57instance (GSplash a sup, GSplash b sup) => GSplash (a :+: b) sup where
57instance (GSplash a sup, GSplash b sup) => GSplash (a :+: b) sup where
58 _GSplash (L1 rep) = _GSplash rep
58 _GSplash (L1 rep) = _GSplash rep
59 _GSplash (R1 rep) = _GSplash rep
59 _GSplash (R1 rep) = _GSplash rep
60+ {-# INLINE[0] _GSplash #-}
62 ( GIsList () subf subf as as
63 ( GIsList () subf subf as as
63 , GAsType supf as
64 , GAsType supf as
64 ) => GSplash (C1 meta subf) supf where
65 ) => GSplash (C1 meta subf) supf where
65 _GSplash p = build ((_GTyped . fromIso (glist @()) . fromIso mIso)) p
66 _GSplash p = build ((_GTyped . fromIso (glist @()) . fromIso mIso)) p
67+ {-# INLINE[0] _GSplash #-}
67instance GSplash sub sup => GSplash (D1 c sub) sup where
69instance GSplash sub sup => GSplash (D1 c sub) sup where
68 _GSplash (M1 m) = _GSplash m
70 _GSplash (M1 m) = _GSplash m
71+ {-# INLINE[0] _GSplash #-}
70--------------------------------------------------------------------------------
73--------------------------------------------------------------------------------
@@ -79,6 +82,7 @@ instance
79 _GDowncast (M1 m) = case _GDowncastC @(HasPartialTypeP as sub) m of
82 _GDowncast (M1 m) = case _GDowncastC @(HasPartialTypeP as sub) m of
80 Left _ -> Left (M1 m)
83 Left _ -> Left (M1 m)
81 Right r -> Right r
84 Right r -> Right r
85+ {-# INLINE[0] _GDowncast #-}
83instance (GDowncast sub l, GDowncast sub r) => GDowncast sub (l :+: r) where
87instance (GDowncast sub l, GDowncast sub r) => GDowncast sub (l :+: r) where
84 _GDowncast (L1 x) = case _GDowncast x of
88 _GDowncast (L1 x) = case _GDowncast x of
@@ -87,22 +91,25 @@ instance (GDowncast sub l, GDowncast sub r) => GDowncast sub (l :+: r) where
87 _GDowncast (R1 x) = case _GDowncast x of
91 _GDowncast (R1 x) = case _GDowncast x of
88 Left _ -> Left (R1 x)
92 Left _ -> Left (R1 x)
89 Right r -> Right r
93 Right r -> Right r
94+ {-# INLINE[0] _GDowncast #-}
91instance GDowncast sub sup => GDowncast sub (D1 m sup) where
96instance GDowncast sub sup => GDowncast sub (D1 m sup) where
92 _GDowncast (M1 m) = case _GDowncast m of
97 _GDowncast (M1 m) = case _GDowncast m of
93 Left _ -> Left (M1 m)
98 Left _ -> Left (M1 m)
94 Right r -> Right r
99 Right r -> Right r
100+ {-# INLINE[0] _GDowncast #-}
96class GDowncastC (contains :: Bool) sub sup where
102class GDowncastC (contains :: Bool) sub sup where
97 _GDowncastC :: sup x -> Either (sup x) (sub x)
103 _GDowncastC :: sup x -> Either (sup x) (sub x)
99instance GDowncastC 'False sub sup where
105instance GDowncastC 'False sub sup where
100 _GDowncastC sup = Left sup
106 _GDowncastC sup = Left sup
107+ {-# INLINE[0] _GDowncastC #-}
103 ( GAsType sub subl
110 ( GAsType sub subl
104 , GIsList () sup sup subl subl
111 , GIsList () sup sup subl subl
105 ) => GDowncastC 'True sub sup where
112 ) => GDowncastC 'True sub sup where
106 _GDowncastC sup = Right (build (_GTyped . fromIso (glist @())) sup)
113 _GDowncastC sup = Right (build (_GTyped . fromIso (glist @())) sup)
107− {-# INLINE _GDowncastC #-}
114+ {-# INLINE[0] _GDowncastC #-}