<div dir="ltr"><div>Hey everyone!</div><div><br></div><div>for context, I have some code where I was seeing how far coerce lets me go to avoid doing wrappers for certain codes,</div><div><br></div><div>i found i had to write the following (mapping an operation over to its newtyped sibling)<br></div><div><br></div><div>```</div><div>-- > :t QRA.wither</div><div>--- forall a b f . Applicative f => (a -> f (Maybe b)) -> RAList a -> f (RAList b)</div><div>---<br></div><div>wither :: forall a b f . (Applicative f, (forall c d .  Coercible c d => Coercible (f c) (f d))  ) =><br>        (a -> f (Maybe b)) -> RAList a -> f (RAList b)<br>wither = \f la ->    coerce     $ QRA.wither f $ coerce la</div><div>```</div><div><br></div><div>i'd much rather be able to write <br></div><div>```</div><div>wither :: forall a b f . (Applicative f) =><br>        (a -> f (Maybe b)) -> RAList a -> f (RAList b)<br>wither = \f la ->    coerce     $ QRA.wither f $ coerce la</div><div>```<br></div><div><br></div><div><br></div><div>this seems like it'd be best done via something like changing the functor class definition to <br></div><div><br></div><div>```<br></div><div>class  (forall c d .  Coercible c d => Coercible (f c) (f d))  ) => Functor f where ..<br></div><div>```</div><div><br></div><div>is there any specific reason why this is not feasible? I cant think of a GADT where this wouldn't be totally safe to do (because unlike in foldable, f is in both the domain and co-domain), but maybe i'm not being imaginative enough?</div><div><br></div><div>look forward to learning what our obstacles are to making this happen for ghc 9.2 :) <br></div><div><br></div><div>-Carter<br></div><div><br></div></div>