#2497: Weird scoping for tyvars in rules
--------------------------------------------+-------------------------------
Reporter: rl | Owner:
Type: bug | Status: reopened
Priority: normal | Milestone:
Component: Compiler | Version: 6.8.3
Severity: normal | Resolution:
Keywords: | Difficulty: Unknown
Testcase: typecheck/should_compile/T2497 | Architecture: Unknown/Multiple
Os: Unknown/Multiple |
--------------------------------------------+-------------------------------
Changes (by duncan):
* status: closed => reopened
* resolution: fixed =>
Comment:
Replying to [comment:4 simonpj]:
It's not entirely obvious to me that this is all fixed, in particular this
point:
> * Inside a RULE, switch on `-XScopedTypeVariables` unconditionally.
I'm using ghc-6.10.0.20080927 and updating bytestring to use `LANGUAGE`
pragmas rather than `-fglasgow-exts`. Without adding `ScopedTypeVariables`
I get errors for the `RULES` pragmas:
{{{
Data/ByteString.hs:453:30: Not in scope: `forall'
Data/ByteString.hs:453:37: Not in scope: `p'
}}}
This is complaining about the code:
{{{
{-# RULES
"ByteString unpack-list" [1] forall p .
unpackFoldr p (:) [] = unpackList p
#-}
}}}
It's not clear to me what the "Right Thing" I'm supposed to do. Should I
be using the `ScopedTypeVariables` to get `RULES` pragmas to be
recognised? Do I need to use `-fuse-rewrite-rules` to have the rules
actually used? What should I be using for older ghc?
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2497#comment:9>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs