Custom Query
Results (25 - 27 of 5837)
| Ticket | Resolution | Summary | Owner | Reporter |
|---|---|---|---|---|
| #5973 | invalid | Rewrite rule not firing for typeclass | SamAnklesaria | SamAnklesaria |
| description |
The following rewrite rule fires for a normal function, but fails to fire as the method of a typeclass. {-# OPTIONS_GHC -O -ddump-rule-firings #-}
module RewriteProblems where
{-# RULES
"rewrite/class" forall a. id1 (id1 a) = RDUnit
"rewrite/static" forall a. id1' (id1' a) = RDUnit
#-}
class Ider a where
id1 :: a -> a
data RewriteD = RDUnit
instance Ider RewriteD where
{-# INLINE[1] id1 #-}
id1 a = RDUnit
classTest :: RewriteD
classTest = id1 (id1 RDUnit)
staticTest :: RewriteD
staticTest = id1' (id1' RDUnit)
{-# INLINE[1] id1' #-}
id1' :: RewriteD -> RewriteD
id1' a = RDUnit
|
|||
| #6102 | invalid | Subclass Specialization in Rewrite Rules | SamAnklesaria | SamAnklesaria |
| description |
Rewrite rules can define a specialized version of a method for some specific datatype, but they cannot currently define a specialized version of a method for some specific superclass. class ClassOne a where
classOneOp :: a -> a
class ClassOne a => ClassTwo a where
classTwoOp :: a -> a
data ClassInstance = ...
instance ClassOne ClassInstance where
classOneOp = ...
specialFunc :: ClassInstance -> ClassInstance
specialFunc = ...
{-# RULES
"willcompile" forall i. classOneOp i = specialFunc
"wontcompile" forall i. classOneOp i = classTwoOp i
#-}
Although we can specialize classOneOp for ClassInstance?, we can't do so for those instances of ClassOne? that are also instances of ClassTwo?. |
|||
| #1516 | wontfix | Add Data.Stream, a library for manipulating infinite lists, to base | WouterSwierstra | WouterSwierstra |
| description |
I'd propose to add a Data.Stream library to base. Data.Stream should be fairly uncontroversial. The module consists largely of a reimplimentation of several functions from Data.List to create, modify, and manipulate infinite lists. There is already a package on Hackage: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/Stream-0.1 I've tried to include Haddock-comments, very similar to those for Data.List. As working with infinite lists can be tricky, I've included warnings clearly stating which functions can diverge. I am aware that the name may cause confusion with Data.List.Stream. I'd welcome suggestions to avoid causing confusion. |
|||
