Add _Cons and _Snoc instances for (Dual s) (Dual t) a b#950
Add _Cons and _Snoc instances for (Dual s) (Dual t) a b#950Taneb wants to merge 1 commit intoekmett:masterfrom
Conversation
This allows treating a cons-list as a snoc-list in a reasonable way and vice versa One use case for this is Dual [a] can be used as a snoc list in an efficient way, if a snoc list is more "semantically" correct.
|
Is it commonplace to interpret |
|
I don't know if it's used often, but I reached for it today, thinking of its |
|
I think this is on edge of being too ad-hoc, and I'm not sure on which side. |
This allows treating a cons-list as a snoc-list in a reasonable way and vice versa
One use case for this is Dual [a] can be used as a snoc list in an efficient way, if a snoc list is more "semantically" correct.