[GHC] #836: rebindable if-then-else syntax

GHC cvs-ghc at haskell.org
Thu Oct 21 03:30:27 EDT 2010


#836: rebindable if-then-else syntax
----------------------------------+-----------------------------------------
    Reporter:  nibro              |        Owner:  SamAnklesaria
        Type:  feature request    |       Status:  new          
    Priority:  normal             |    Milestone:  _|_          
   Component:  Compiler (Parser)  |      Version:  6.13         
    Keywords:                     |     Testcase:  N/A          
   Blockedby:                     |   Difficulty:  Unknown      
          Os:  Unknown/Multiple   |     Blocking:               
Architecture:  Unknown/Multiple   |      Failure:  None/Unknown 
----------------------------------+-----------------------------------------

Comment(by simonpj):

 My thoughts

  * Like igloo, I would much prefer a `RebindableSyntax` flag (using
 `ImplicitPrelude` is anyway a hack) than one for 'if' alone.  I really
 don't want `RebindableIf`.

  * There is no difficulty with using the old typing rule for `if` when
 `RebindableSyntax` is off, and the new one when it is on. (That isn't the
 way other rebindable syntax is done, but it doesn't matter.)  Doing that
 means that the Prelude doesn't need to export `ifThenElse`

  * Many libraries use if, but few (none?) use both (a) rebindable syntax
 and (b) `if` with an unlifted return type. That would be the unsupported
 combination under the new scheme.  But there's a way out in that case: use
 `case`.

 In short, my proposal is:
  * Add `RebindableSyntax` flag. (It might imply `NoImplicitPrelude`.)
  * Choose which typing rule to use for `if` based on the flag

 Simon

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


More information about the Glasgow-haskell-bugs mailing list