ross        2005/05/04 03:28:08 PDT

  Modified files:
    ghc/compiler/rename  RnExpr.lhs 
    ghc/compiler/typecheck TcArrows.lhs TcRnMonad.lhs 
                           TcRnTypes.lhs 
  Log:
  Another go at the handling of -< in arrow notation, continuing and
  fixing the changes in
  
        http://www.haskell.org/pipermail/cvs-all/2005-April/040391.html
  
  Now do the same thing in the renamer as we do in the type checker,
  i.e. return to the environment of the proc when considering the left
  argument of -<.
  
  This is much simpler than the old proc_level stuff, and matches the
  type rules more clearly.  But there is a change in error messages.
  For the input
  
        f :: Int -> Int
        f = proc x -> (+x) -< 1
  
  GHC 6.4 says
  
        test.hs:6:
            Command-bound variable `x' is not in scope here
                Reason: it is used in the left argument of (-<)
            In the second argument of `(+)', namely `x'
            In the command: (+ x) -< 1
            In the definition of `f': f = proc x -> (+ x) -< 1
  
  but now we just get the blunt
  
        test.hs:6:16: Not in scope: `x'
  
  The beauty is all on the inside.
  
  Similarly leakage of existential type variables (arrow1) is detected,
  but the error message isn't very helpful.
  
  Revision  Changes    Path
  1.139     +12 -6     fptools/ghc/compiler/rename/RnExpr.lhs
  1.15      +10 -30    fptools/ghc/compiler/typecheck/TcArrows.lhs
  1.52      +1 -0      fptools/ghc/compiler/typecheck/TcRnMonad.lhs
  1.59      +38 -0     fptools/ghc/compiler/typecheck/TcRnTypes.lhs
_______________________________________________
Cvs-ghc mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to