Ticket #29 (closed bug report: fixed)

Opened 5 years ago

Last modified 5 years ago

Implement checks on the use of forall-quantified types

Reported by: nibro Owned by: nibro
Priority: blocker Milestone: Full code support
Component: parser Version:
Keywords: Cc:

Description (last modified by nibro) (diff)

Currently the parser treats all the forall-enabling extensions as equivalent. As long as one of them is on, to allow the forall keyword, then all uses of that keyword are allowed. We need checks on where they are allowed.

EDIT: The following is no longer valid:

First we have the data constructor uses.

Second we have the actual type uses:

  • LiberalTypeSynonyms?: Allow forall-quantified types in type synonym declarations, as well as applying type synonyms to forall-quantified types.
  • Rank2Types: Allow forall-quantified types as arguments to functions, i.e. on the left of a function arrow.
  • RankNTypes: Allow forall-quantified types anywhere in actual types, except as arguments to type synonyms (requires LiberalTypeSynonyms?).
  • ImpredicativeTypes?: Allow forall-quantified types as arguments to type constructors.

EDIT: Here is what should go instead:

See http://nibrofun.blogspot.com/2009/06/whats-in-forall.html for why this has changed.

This is part of ticket #14.

Change History

Changed 5 years ago by nibro

  • description modified (diff)

Changed 5 years ago by nibro

  • status changed from new to assigned

After some further thought, I have decided not to do even half of what I first intended regarding this issue. The full details of why I think so can be seen on my blog: http://nibrofun.blogspot.com/2009/06/whats-in-forall.html

Basically, the checks I will do amounts only to a) checking that ExistentialQuantification? is on when the corresponding syntax for data constructor declarations is used, and b) check that one of the other forall-enabling extensions are on when explicit quantification is used in an actual type.

Changed 5 years ago by nibro

  • description modified (diff)

Changed 5 years ago by nibro

  • description modified (diff)

Changed 5 years ago by nibro

  • description modified (diff)

Changed 5 years ago by nibro

  • status changed from assigned to closed
  • resolution set to fixed

I've implemented the checks as noted. I hope they are the correct ones, time and testing will tell.

Note: See TracTickets for help on using tickets.