#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):

 I'm confused. My patch implements the following:

 {{{
 InfixE Nothing + (UInfixE a + b)            ---> SectionR + (OpApp a + b)
 InfixE Nothing + (ParensE $ UInfixE a + b)  ---> SectionR + (HsPar $ OpApp
 a + b)
 }}}

 This means that we can use the first to represent {{{(+ a + b)}}} and the
 second to represent {{{(+ (a + b))}}}. All good, we can represent the
 things we need to. The problem is that {{{InfixE}}} behaves quite
 differently for sections than it does for non-sections (the special
 handling I discussed in commment 15).

 It seems there are two ways to proceed:
  1. Leave the situation with sections as implemented in my patch, so
 {{{UInfixE}}} doesn't need to worry about sections, at the cost of some
 special cases in {{{InfixE}}}
  2. Remove the special cases of {{{InfixE}}} by making the {{{UInfixE}}}
 constructor handle sections:
  {{{
  data Exp =
  ...
     UInfixE (Maybe Exp) Exp (Maybe Exp)
  ...
  }}}

 Which are you suggesting?

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4430#comment:21>
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