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
The orphan rule seems overly restrictive for what I imagine is a somewhat common case of defining a new class, and implementing instances implied by that class. Specifically, if A:A (package A with class A) is defined and we wish to define an instance of B:B, like so:
(define-instance (A:A :t => B:B :t) ...)
then we need to define this in the package B. This is inconvenient, because it means that we would need to put A:A very early in our project, divorcing it from additional logic/library functionality.
I propose we just add this as a special case to the orphan rule. I don't think we need to generalize it (e.g., (A1:A1 :t) (A2:A2 :t) => B:B :t) or anything like that), but it might be worth it.
Any downsides to doing this?
The text was updated successfully, but these errors were encountered:
One minor minus that comes to mind is that this would lead to a degree of arbitrariness in the decision about where to put multiply-constrained typeclass instances.
The orphan rule seems overly restrictive for what I imagine is a somewhat common case of defining a new class, and implementing instances implied by that class. Specifically, if
A:A
(packageA
with classA
) is defined and we wish to define an instance ofB:B
, like so:then we need to define this in the package
B
. This is inconvenient, because it means that we would need to putA:A
very early in our project, divorcing it from additional logic/library functionality.I propose we just add this as a special case to the orphan rule. I don't think we need to generalize it (e.g.,
(A1:A1 :t) (A2:A2 :t) => B:B :t)
or anything like that), but it might be worth it.Any downsides to doing this?
The text was updated successfully, but these errors were encountered: