Changes between Initial Version and Version 1 of Ticket #2588


Ignore:
Timestamp:
Sep 16, 2008 11:36:17 AM (6 years ago)
Author:
simonpj
Comment:

Good suggestion, but harder to implement. Without ScopedTypeVariables, forall is not a keyword, so GHC is trying to parse that thing as a type, and it just doesn't follow the syntax for types.

The solution is probably this:

  • Do not treat => specially in the parser
  • Instead parse it as an infix operator
  • In the post-parsing re-organisation (RdrHsSyn), unswizzle the => into a constraint set
  • But in doing so, if the stuff on the left of the => doesn't look like a constraint set, look for a leading forall and complain appropriately

Not really hard, but fiddly.

Simon

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #2588

    • Property Difficulty changed from to Unknown
    • Property Milestone changed from to 6.12 branch
  • Ticket #2588 – Description

    initial v1  
    1616}}} 
    1717 
    18 [I personally usually want ScopedTypeVariables rather than RankNTypes, but its still a very useful hint at where to look] 
     18[I personally usually want `ScopedTypeVariables` rather than `RankNTypes`, but its still a very useful hint at where to look] 
    1919 
    2020However, trying the program: