Conversation
|
The |
907d6eb to
938af86
Compare
|
Eh, it looks like there are weird test failures anyway. |
d566519 to
6795ea2
Compare
|
I fixed test failures and made only one instance incoherent. |
5ae1144 to
c30d1db
Compare
c30d1db to
8e7a863
Compare
|
The incoherence seems fine here as there really is only one possible dictionary (modulo bottoms). I'm less clear about the runtime performance trade-off. Will this all optimize away for nontrivial concrete index lists? I guess it might, even though What about type-inference/errors, especially in the case of index-polymorphic code? Of course *Optics.Core> :t (%)
(%)
:: (Is k (Join k l), Is l (Join k l),
AppendIndices is js (Append is js)) =>
Optic k is s t u v
-> Optic l js u v a b -> Optic (Join k l) (Append is js) s t a balthough we could make this a bit more compact by dropping the third parameter from |
According to my experiments it does. I modified tests so it's also checked there.
I modified it to use
I removed the third argument from the class, the signature looks a bit better now. λ> :t (%)
(%)
:: (Is k (Join k l), Is l (Join k l), AppendIndices is js) =>
Optic k is s t u v
-> Optic l js u v a b -> Optic (Join k l) (Append is js) s t a b |
|
@adamgundry ping |
|
Though I'm not 100% sure if it's worth it. It looks like it's just going to require putting corresponding |
This is a point on which I'm somewhat hazy, but I think
Yes, I'm on the fence with this one too. The extra constraint will probably be solved automatically in most user code (which will have concrete indices), but it will still potentially show up in error messages and the like. And it does potentially incur some runtime work to get away from an |
|
After more consideration let's leave it. |
No description provided.