#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): There's no decent way out of this. If one argument to `ifThenElse` is a `Double#` it would be passed in a different register than if it was a pointer. So no single blob of code for `ifThenElse` will do. That's why GHC doesn't allow parametric polymorphism for unboxed types. I think the best we can do is to say that if rebindable syntax is off, we use the old if-then-else typing rule, and if it's on we use the new one. Sadly that means that if you want rebindable syntax you can't use if-then- else with an unboxed result type. Moreover, currently rebindable syntax is invoked by `-fno-implicit- prelude` (a rather odd flag to invoke it), and that in turn is necessarily used in compiling the `base` library. So we'd have to separate the two flags, which is probably a good thing anyway. It's not easy to choose which path to take based on the type of the alternatives, because the choice has to be made during typechecking, when the type of the alternatives is itself being worked out. Also it'd be very odd to have two different ways of typing `if`. Simon -- Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/836#comment:23> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler _______________________________________________ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs