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
At the moment, side-switch happens when a type expression of the form foo Eliom_fragment.t. It doesn't work with aliases. More problematic, even if we were to resolve aliases, there is still the issue of abstract types that contains some client fragments (type 'a t = { foo : int ; bar : ('a * string) Eliom_fragment.t }).
One proposition to resolve this is to use a similar mechanism to variance: it's correctly propagated by the compiler and annotate type variables. For a given type constructor, we just need to lookup the type declaration to know we should switch side.
The text was updated successfully, but these errors were encountered:
This is now implemented with explicit annotations on the type parameters.
For example, in (client side) Eliom_fragment:
type+'a[@client] t
I don't think it's a good idea to have any inference for this (as opposed to variance annotations). This works also for multiple parameters: type ('a, 'b[@client], 'c) t.
Currently, it is not very tested. In particular the relation to type variable and unification might need tweaking. Oh, and it's completely unchecked (very bad). WIP.
One (big) problem is that I had to change the typedtree for this, which is something I carefully avoided until now. It might be possible to work around that with some more annotations.
At the moment, side-switch happens when a type expression of the form
foo Eliom_fragment.t
. It doesn't work with aliases. More problematic, even if we were to resolve aliases, there is still the issue of abstract types that contains some client fragments (type 'a t = { foo : int ; bar : ('a * string) Eliom_fragment.t }
).One proposition to resolve this is to use a similar mechanism to variance: it's correctly propagated by the compiler and annotate type variables. For a given type constructor, we just need to lookup the type declaration to know we should switch side.
The text was updated successfully, but these errors were encountered: