If we have a structure S := {T of m T} composed of one mixin m, there is a coercion from S to m (which is currently available and reliable upon).
Now if mixin is turned into a factory which is equivalent to two new mixins m1 and m2 (we have builders m -> m1 and m -> m2), then there are now two coercions S -> m1 and S -> m2, but no more S -> m, we must add it. We should add a new command for that, e.g. HB.yields f where f has type S -> m.
Note that this actually means m <-> m1 * m2, and that would not be true for all factories, but it must be true for mixins that get turned into factories, because the point is that the structure contents must stay the same (up to iso).
In further versions we might actually want to verify this is an iso, but this is longer term.
I suggest implementing a command HB.cobuilder that takes a factory as argument, which automatically assumes the maximal class entailed by this factory and invites the user to build the factory.
If we have a structure
S := {T of m T}
composed of one mixinm
, there is a coercion fromS
tom
(which is currently available and reliable upon).Now if mixin is turned into a factory which is equivalent to two new mixins
m1
andm2
(we have buildersm -> m1
andm -> m2
), then there are now two coercionsS -> m1
andS -> m2
, but no moreS -> m
, we must add it. We should add a new command for that, e.g.HB.yields f
wheref
has typeS -> m
.Note that this actually means
m <-> m1 * m2
, and that would not be true for all factories, but it must be true for mixins that get turned into factories, because the point is that the structure contents must stay the same (up to iso).In further versions we might actually want to verify this is an iso, but this is longer term.