Skip to content

Covariance issues with wrapping #108

Open
@Drup

Description

@Drup

While working with the ppx, I noticed something ... strange.

# let x = Html5.Xml.W.nil () ;;
val x : '_a list = []  
# let x : _ list = Html5.Xml.W.nil () ;;
val x : 'a list = []  

Apparently, the functor stack hides the covariance, since Xml_wrap.S.tlist is not marked covariant.
@vasilisp Do you think we could turn it covariant ? Are all the wrapper we have covariants ? Given the heavy use of subtyping, It would seems natural to enforce that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions