variable {Cont Idx Elem} [IndexType Idx] [Indexed Cont Idx Elem]
variable (x y : Cont)
-- broken
#check Function.HasUncurry.uncurry fun i => x[i]
#check Function.HasUncurry.uncurry fun i j => (x[i],y[j])
-- works
#check Function.HasUncurry.uncurry fun i => (x[i] : Elem)
#check Function.HasUncurry.uncurry fun i j => ((x[i] : Elem),(y[j] : Elem))
Because the x[i] elaboration is postponed until the type of x[i] is known it causes failure to synthesize the instance in HasUncurry.
I'm thinking of going back to using GetElem.getElem instead of Indexed.get. Then the custom element access notation can be implemented just as a macro and the elaboration mess can be completely avoided.
I broke the element access notation again
Because the
x[i]
elaboration is postponed until the type ofx[i]
is known it causes failure to synthesize the instance inHasUncurry
.I'm thinking of going back to using
GetElem.getElem
instead ofIndexed.get
. Then the custom element access notation can be implemented just as a macro and the elaboration mess can be completely avoided.