Ticket #5830 (closed bug: fixed)
Arrow if/then/else sugar breaks type inference
Description
Starting in GHC 7.0, using the Arrows if/then/else syntactic sugar for ArrowChoice? doesn't propagate type constraints the way I expect. This bug still exists in 7.2.
The expected type of the result of the conditional should constrain the type of each branch of the conditional. Instead, the branches remain unconstrained. If the arrow in the branches is polymorphic and its argument type doesn't completely constrain its result (I used "read" in this test case) then GHC reports that the types are ambiguous:
Ambiguous type variable `c0' in the constraint:
(Read c0) arising from a use of `read'
Using the case-expression sugar instead works fine.
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

