Ticket #4125 (closed bug: invalid)
Template haskell rejects duplicate instances before they're spliced
| Reported by: | lilac | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | 7.4.1 |
| Component: | Template Haskell | Version: | 6.12.1 |
| Keywords: | Cc: | ||
| Operating System: | Unknown/Multiple | Architecture: | Unknown/Multiple |
| Type of failure: | GHC rejects valid program | Difficulty: | |
| Test Case: | Blocked By: | #4230 | |
| Blocking: | Related Tickets: |
Description
Suppose I want to see (from within ghci) how to write an instance declaration in the TH AST. I try:
Prelude> runQ $ [d| instance Monad Maybe where |]
<interactive>:1:13:
Duplicate instance declarations:
instance Monad Maybe -- Defined at <interactive>:1:13-23
instance Monad Maybe -- Defined in Data.Maybe
In the Template Haskell quotation
[d|
instance Monad Maybe where |]
In the expression:
[d|
instance Monad Maybe where |]
In the definition of `it':
it = [d|
instance Monad Maybe where |]
This seems ridiculous; I'm not trying to create an instance, just to create a TH AST fragment.
Change History
Note: See
TracTickets for help on using
tickets.
