Hi! I'm trying to extend mlish with subtypes. Here's what I understand of the current state of things:
- mlish infers variance on the polymorphic type variables (
Xs) for custom variants declared with define-type, at least if they are not (mutually-)recursive types.
#%appseems to handle subtyping just fine
- there is no subtyping relationship (I'm rolling my own, which takes advantage of
#:arg-variancesannotations, so that it doesn't need a special case for every type)
- some primitive types lack these variance annotations, e.g. the
stlc+cons.rkt(this was trivial to fix)
- most importantly, the
type-constraints.rktdo not take subtyping into account, this means that it will fail to unify
Xand some type if it already unified
Xwith a sub/super-type, regardless of the variance on
I'm currently implementing that last point. Are there any other things that I should be aware of?
Did I miss a branch or piece of code which already implements parts of these? E.g. I'm surprised that I didn't find a general subtyping relationship which uses the
#:arg-variances annotations, but maybe it's just implemented in another file.
Also, could we enable the wiki either here on bitbucket or on github? This would allow users like me to add some notes about the example languages and similar implementation details, which don't really have their place in the official documentation, as they are likely to evolve.