Ticket #1544 (new bug)
Derived Read instances for recursive datatypes with infix constructors are too inefficient
| Reported by: | jcpetruzza@… | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | 7.6.2 |
| Component: | Compiler | Version: | 6.6.1 |
| Keywords: | Cc: | koen@…, doaitse@…, malcolm@…, emlempsi@… | |
| Operating System: | Unknown/Multiple | Architecture: | Unknown/Multiple |
| Type of failure: | Other | Difficulty: | Unknown |
| Test Case: | Blocked By: | ||
| Blocking: | Related Tickets: |
Description (last modified by simonpj) (diff)
Consider this definition:
data Exp = C | Exp :+: Exp | Exp :-: Exp deriving ( Read, Show )
Now, try something like:
> read "((((((((((C))))))))))" :: Exp
Even this simple expression may take several seconds to parse. It gets worse if you keep adding parenthesis. And even worse if you add more infix constructors....
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

