cvs commit: hugs98/src parser.y

nordland@glass.cse.ogi.edu nordland@glass.cse.ogi.edu
Wed, 19 Sep 2001 14:36:04 -0700


nordland    2001/09/19 14:36:04 PDT

  Modified files:
    src                  parser.y 
  Log:
  Fixed the incorrect acceptance of rank-2 types like
  
     (Ord a => Tree a) -> IO ()
  
  The parser now insists that such types be explicitly quantified, as in
  
     (forall a . Ord a => Tree a) -> IO ()
  
  This also holds for the (somewhat counterintuitive) syntax for constructors
  with local existential quantification, i.e.,
  
     Ord a => Con (Tree a)
  
  is banned in favor of
  
     forall a . Ord a => Con (Tree a)
  
  *Note*, however, that this fix doesn't solve the "rank-2 implicit parameters"
  problem reported by John Hughes earlier today:
  
     foo :: ((?x :: Int) => b) -> Int -> b
     foo s z = s with ?x = z
  
  Was that feature anticipated?  In any case, there are two problems that
  must be solved here:
  (1) Loosen up the syntax somehow so that local monomorphic contexts
      are allowed -- perhaps by allowing
  
          (forall . (?x :: Int) => b) -> Int -> b
  
  (2) Fixing the erroneous unification that John describes.
  
  [Who will take the lead and define what all the common Haskell extensions
   really mean when used in conjunction?]
  
  Revision  Changes    Path
  1.23      +3 -4      hugs98/src/parser.y