#4430: Better support for resolving infix expressions in template haskell
---------------------------------+------------------------------------------
    Reporter:  reinerp           |        Owner:  igloo       
        Type:  feature request   |       Status:  patch       
    Priority:  normal            |    Milestone:  7.4.1       
   Component:  Template Haskell  |      Version:  6.12.3      
    Keywords:                    |     Testcase:              
   Blockedby:                    |   Difficulty:              
          Os:  Unknown/Multiple  |     Blocking:              
Architecture:  Unknown/Multiple  |      Failure:  None/Unknown
---------------------------------+------------------------------------------

Comment(by reinerp):

 Because our hypothetical quasiquoter doesn't know that it's illegal (you
 need to know the operator fixities for that). And even though there is at
 most one legal way to resolve the expression  {{{(1 + 2 +)}}}, namely to
 {{{((1 + 2) +)}}}, it would not be acceptable for our quasiquoter to do
 this conversion:
  * firstly, this turns some illegal haskell expressions into legal ones,
 which in itself is not a huge problem
  * more importantly, some (illegal, but plausible) expressions will be
 given surprising meanings. For instance, consider {{{(* 2 + 1)}}}. It is
 illegal in haskell, but one might think it should mean {{{(\x -> x * 2 +
 1)}}}. However, the above conversion would turn it into {{{(* (2 + 1))}}},
 which is completely different.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4430#comment:19>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to