Fri Dec 30 08:36:31 EST 2011
SArray has no 'a' param
Continuation of last post. Basically, I don't quite understand why it
doesn't infer, but I guess this is because too much information is
lost in the SArray class.
(L (a t1)), L (a t2)) <-> a (L t1, L t2)
Is it possible to do this somewhere else, implementing the isomorphism
in terms of a substrate, i.e. "fake struct array".
I.e. the isomorphism would map "struct of array" to "array of struct"
only on the type level. The implementation would then do the wrapping
such that these 2 cases can be distinguished.
It feels a bit messy though, but I see no way to make this isomorphism
work without somehow rooting it in representation.
Alternatively, would it be possible to add a fake method to Loop class
that exposes the array parameter?
Ok, I tried for a bit and it's too opaque. I just don't understand
it. All I do is fiddling to see what the checker says... Let's go for
* I can't get the translation _get' -> multiple _get to work on the
typed level due to inference errors.
* It might be simpler to solve it in Term, I.e. allow a
representation of a struct (which would normally be only one Ref)
to be a RefList. This is possibly simpler to understand.