From: John Meacham Date: Fri, 3 Mar 2006 04:57:53 +0000 (+0000) Subject: make head/build rule apply to all types, not just Bool. X-Git-Tag: 2007-09-13~414 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=23ce9fad436bb4beff4671a11b2704da2104e462;p=ghc-base.git make head/build rule apply to all types, not just Bool. --- diff --git a/GHC/List.lhs b/GHC/List.lhs index 0d43453..705fdc9 100644 --- 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 -"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)