Polymorphic components, so far

Iavor Diatchki iavor.diatchki at gmail.com
Thu Feb 1 19:03:23 EST 2007


Hello,
Thanks to everyone who took time to comment on my notes.  My & Isaac's
previous post spawned a few separate discussions so I though I'd send
a separate message to summarize the status of what has happened so far
with regard to polymorphic components.

* Rank-2 vs Rank-n types.  I think that this is the most important
issue that we need to resolve which is why I am placing it first :-)
Here are our options:
  - option 1: Hugs style rank-2 types (what I described, very briefly)
  - option 2: GHC 6.4 style rank-2 types. As far as I understand,
these are the details:
      * Based on "Putting Type Annotations to Work".
     * Predicative (type variables range only over simple (mono) types)
  We do not need to compare schemes for equality but, rather, we
compare them for generality, using a kind of sub-typing.  There

* Notation for polymorphic types with explicit quantifiers.  The main
issue is if we should allow some corner case notational issues, such
as empty quantifier lists, and quantified variables that are not
mentioned in the type.
  - option 1: disallow these cases because they are likely to be
accidental mistakes.
  - option 2: allow them because they make automatic program generation simpler.
My initial proposal was suggesting 2 but I think that, having heard
the arguments, I am leaning towards option 1.

* Equality of schemes for labeled fields in different constructors.
My suggestion did not seem to be too controversial.  Stephanie is
leaning towards a more semantic comparison of  schemes.  Indeed, just
using alpha equivalence might be a bit too weak in some cases.
Another, still fairly syntactic option, would be to pick a fixed order
for the variables in quantifiers (e.g., alphabetic) for the purposes
of comparison.

* Pattern matching on polymorphic fields.  This does not appear to be
too controversial, although Atze  had some reservations about this
design choice.

This is all that I recall, apologies if I missed something (if I did
and someone notices, please post a replay so that we can keep track of
what is going on).

-Iavor


More information about the Haskell-prime mailing list