projects
/
haskell-directory.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
feb4623
)
make head/build rule apply to all types, not just Bool.
author
John Meacham
<john@repetae.net>
Fri, 3 Mar 2006 04:57:53 +0000
(
04:57
+0000)
committer
John Meacham
<john@repetae.net>
Fri, 3 Mar 2006 04:57:53 +0000
(
04:57
+0000)
GHC/List.lhs
patch
|
blob
|
history
diff --git
a/GHC/List.lhs
b/GHC/List.lhs
index
0d43453
..
705fdc9
100644
(file)
--- a/
GHC/List.lhs
+++ b/
GHC/List.lhs
@@
-63,7
+63,7
@@
badHead = errorEmptyList "head"
-- This rule is useful in cases like
-- head [y | (x,y) <- ps, x==t]
{-# RULES
-- This rule is useful in cases like
-- head [y | (x,y) <- ps, x==t]
{-# RULES
-"head/build" forall (g::forall b.(Bool->b->b)->b->b) .
+"head/build" forall (g::forall b.(a->b->b)->b->b) .
head (build g) = g (\x _ -> x) badHead
"head/augment" forall xs (g::forall b. (a->b->b) -> b -> b) .
head (augment g xs) = g (\x _ -> x) (head xs)
head (build g) = g (\x _ -> x) badHead
"head/augment" forall xs (g::forall b. (a->b->b) -> b -> b) .
head (augment g xs) = g (\x _ -> x) (head xs)