X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Flib%2Fstd%2FPrelBase.lhs;fp=ghc%2Flib%2Fstd%2FPrelBase.lhs;h=b74da36e63c5c2de7eb519f33f4fcacf0860dd3e;hb=223348019d6604bc4f44c267fe3a62a97aa24515;hp=7cc6ef86df800911b257ca32b64a801edc118a73;hpb=87aae97c8e345c559dd3c74474bec39851b97765;p=ghc-hetmet.git diff --git a/ghc/lib/std/PrelBase.lhs b/ghc/lib/std/PrelBase.lhs index 7cc6ef8..b74da36 100644 --- a/ghc/lib/std/PrelBase.lhs +++ b/ghc/lib/std/PrelBase.lhs @@ -1,5 +1,5 @@ % ----------------------------------------------------------------------------- -% $Id: PrelBase.lhs,v 1.54 2001/10/02 16:15:10 simonpj Exp $ +% $Id: PrelBase.lhs,v 1.55 2001/10/17 15:40:02 simonpj Exp $ % % (c) The University of Glasgow, 1992-2000 % @@ -275,7 +275,14 @@ augment g xs = g (:) xs "foldr/id" foldr (:) [] = \x->x "foldr/app" forall xs ys. foldr (:) ys xs = append xs ys -"foldr/cons" forall k z x xs. foldr k z (x:xs) = k x (foldr k z xs) +-- The foldr/cons rule looks nice, but it can give disastrously +-- bloated code when commpiling +-- array (a,b) [(1,2), (2,2), (3,2), ...very long list... ] +-- i.e. when there are very very long literal lists +-- So I've disabled it for now. We could have special cases +-- for short lists, I suppose. +-- "foldr/cons" forall k z x xs. foldr k z (x:xs) = k x (foldr k z xs) + "foldr/nil" forall k z. foldr k z [] = z "augment/build" forall (g::forall b. (a->b->b) -> b -> b)