#2600: Bind type variables in RULES
-----------------------------+----------------------------------------------
Reporter: simonpj | Owner: simonpj
Type: feature request | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 6.8.3
Severity: normal | Resolution:
Keywords: | Difficulty: Unknown
Testcase: | Architecture: Unknown
Os: Unknown |
-----------------------------+----------------------------------------------
Changes (by simonpj):
* owner: => simonpj
Comment:
How annoying. You're right, it's impossible, because the 't' isn't
mentioned in the type of 'f', or 'x'.
What would we like to write? Perhaps something like
{{{
"myrule" forall (type t :: *->*) (f :: a->a) x.
from (tmap f (to x :: t a)) = map f (from (to x :: t a))
}}}
We need a syntactic clue to distinguish the '''type''' binders in the
forall from the '''term''' binders. Saying "the signature mentions "*"
seems a bit flaky to me. My suggestion above is to re-use the keyword
`type`.
Incidentally, once the rule is parsed and typechecked, the simplifier will
have no trouble doing the right thing.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2600#comment:1>
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