math-comp / hierarchy-builder

High level commands to declare a hierarchy based on packed classes
MIT License
97 stars 21 forks source link

#[infer(var = "R", from ="Type")] #140

Closed gares closed 3 years ago

gares commented 3 years ago
pi8027 commented 3 years ago

IIUC, subtyping functions should preserve phantom arguments and displays. For example, in the master branch of MathComp:

GRing.Algebra.lalgType
     : forall (R : ringType) (phR : phant R), GRing.Algebra.type (R:=R) phR -> GRing.Lalgebra.type (R:=R) phR

Order.Total.porderType
     : forall disp : unit, orderType disp -> porderType disp

In MathComp, these arguments appear only in the argument of structure records, and do not appear in mixins and classes. Displays should not actually appear in mixins and classes. I think we need some special treatments for these points.

gares commented 3 years ago

OK, I'll try something