You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We use coerceC to model Core's casts. However, it introduces some problems. For one, it basically duplicates the functionality of RepCat, but for different types (Coercible ones). The other problem is that it means all newtypes that are ever coerced need to have their constructors in scope whenever categorize is called. This is especially problematic for private constructors.
could we avoid the newtype constructor scoping issues? (At the expense of using DeriveAnyClass and deriving (Newtype) on all newtypes) If we manage to switch to Generics, this could be even simpler.
The complicated part being that Coercions get combined, so a coercion like TyConAppCo Representational sumTyCon [TyConAppCo Representational productTyCo []] would become abstC . abstC, not just a single abstC. I think we can approach this by inspecting the coercion and converting it into a composition of HasRep operations. Could be complicated to implement, though, because I'm not sure how to destructure Coercions, since they're all private.
We use
coerceC
to model Core's casts. However, it introduces some problems. For one, it basically duplicates the functionality ofRepCat
, but for different types (Coercible
ones). The other problem is that it means all newtypes that are ever coerced need to have their constructors in scope whenevercategorize
is called. This is especially problematic for private constructors.Conal has brought up this issue in both
If we had something along the lines of
could we avoid the newtype constructor scoping issues? (At the expense of using
DeriveAnyClass
andderiving (Newtype)
on all newtypes) If we manage to switch to Generics, this could be even simpler.The complicated part being that Coercions get combined, so a coercion like
TyConAppCo Representational sumTyCon [TyConAppCo Representational productTyCo []]
would becomeabstC . abstC
, not just a singleabstC
. I think we can approach this by inspecting the coercion and converting it into a composition ofHasRep
operations. Could be complicated to implement, though, because I'm not sure how to destructure Coercions, since they're all private.(Extricated from https://kitty-hawk.atlassian.net/browse/SW-2657)
The text was updated successfully, but these errors were encountered: