subst
specialized to Id
.
subst
specialized to Id
.
According to Miles, @specialized doesn't help here. Maybe manually specialize.
Variants of apply
, subst
, and unsubst
that require
specifying the tag type but are more likely to infer the other
type parameters.
Add a tag T
to A
.
Add a tag T
to A
.
NB: It is unsafe to subst
or unsubst
a tag in an F
that is
sensitive to the A
type within. For example, if F
is a
GADT, rather than a normal ADT, it is probably unsafe. For
"normal" types like List
and function types, it is safe. More
broadly, if it is possible to write a legal
scalaz.InvariantFunctor over the parameter, subst
of that
parameter is safe.
We do not have a
type role
system in Scala with which to declare the exact situations under
which subst
is safe. If we did, we would declare that subst
is safe if and only if the parameter has "representational" or
"phantom" role.
Add a tag T
to G[_]
Remove the tag T
, leaving A
.
unsubst
specialized to Id
.
unsubst
specialized to Id
.