#6102: Subclass Specialization in Rewrite Rules
-------------------------------+--------------------------------------------
Reporter: SamAnklesaria | Owner: SamAnklesaria
Type: feature request | Status: closed
Priority: normal | Milestone:
Component: Compiler | Version: 7.4.1
Resolution: invalid | Keywords:
Os: Unknown/Multiple | Architecture: Unknown/Multiple
Failure: None/Unknown | Difficulty: Unknown
Testcase: | Blockedby:
Blocking: | Related:
-------------------------------+--------------------------------------------
Comment(by SamAnklesaria):
I don't think I expressed the feature request very well. The idea was that
rewriting would only occur when the types matched. "willcompile" will only
change classOneOp to specialFunc when the result is a ClassInstance.
Likewise, I was thinking it would be useful to have "wontcompile" only
change classOne to classTwoOp when the result is shown to be an instance
of ClassTwo.
In your example, one couldn't assume that the result of classOneOp
(classOneOp a) was an instance of ClassTwo, and the rewrite wouldn't
happen.
I don't know if this kind of behavior is possible, but it isn't something
that would produce ill typed expressions.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/6102#comment:4>
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