Re:OCaml 4.03: Everything else
by catnaroek on Wednesday March 02, 2016 @05:54AM
(#11209176)
I inverted the roles of `foo` and `bar` with respect to my previous post. In `foo`'s definition, the self-type is `'a`. Note how `foo` has a method that takes an argument of type `'a` - a contravariant occurrence of the self-type. The consequence is that, although `bar` inherits `foo`, their associated structural types are neither a subtype of the other.
[ Parent
| on HN ]
There are no comments on this comment yet.