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