Commit 873dc895 authored by Simon Marlow's avatar Simon Marlow

foldl1' was added to Data.List in GHC 6.4.x

parent ed3d36bc
...@@ -39,9 +39,10 @@ import UniqFM ...@@ -39,9 +39,10 @@ import UniqFM
import Unique import Unique
import State import State
import Outputable import Outputable
import Util
import Data.Maybe import Data.Maybe
import Data.List import Data.List ( nub )
-- | Clean out unneeded spill/reloads from this top level thing. -- | Clean out unneeded spill/reloads from this top level thing.
cleanSpills :: LiveCmmTop -> LiveCmmTop cleanSpills :: LiveCmmTop -> LiveCmmTop
......
...@@ -20,6 +20,7 @@ module Util ( ...@@ -20,6 +20,7 @@ module Util (
mapFst, mapSnd, mapFst, mapSnd,
mapAndUnzip, mapAndUnzip3, mapAndUnzip, mapAndUnzip3,
nOfThem, filterOut, partitionWith, splitEithers, nOfThem, filterOut, partitionWith, splitEithers,
foldl1',
lengthExceeds, lengthIs, lengthAtLeast, lengthExceeds, lengthIs, lengthAtLeast,
listLengthCmp, atLength, equalLength, compareLength, listLengthCmp, atLength, equalLength, compareLength,
...@@ -88,8 +89,8 @@ module Util ( ...@@ -88,8 +89,8 @@ module Util (
import FastTypes import FastTypes
#ifdef DEBUG #if defined(DEBUG) || __GLASGOW_HASKELL__ < 604
import Panic ( panic, trace ) import Panic
#endif #endif
import Control.Exception ( Exception(..), finally, catchDyn, throw ) import Control.Exception ( Exception(..), finally, catchDyn, throw )
...@@ -98,11 +99,10 @@ import Data.Dynamic ( Typeable ) ...@@ -98,11 +99,10 @@ import Data.Dynamic ( Typeable )
import Data.IORef ( IORef, newIORef ) import Data.IORef ( IORef, newIORef )
import System.IO.Unsafe ( unsafePerformIO ) import System.IO.Unsafe ( unsafePerformIO )
import Data.IORef ( readIORef, writeIORef ) import Data.IORef ( readIORef, writeIORef )
import Data.List hiding (group)
import qualified Data.List as List ( elem ) import qualified Data.List as List ( elem )
#ifndef DEBUG #ifdef DEBUG
import Data.List ( zipWith4 )
#else
import qualified Data.List as List ( notElem ) import qualified Data.List as List ( notElem )
#endif #endif
...@@ -363,6 +363,16 @@ isn'tIn msg x ys ...@@ -363,6 +363,16 @@ isn'tIn msg x ys
# endif /* DEBUG */ # endif /* DEBUG */
\end{code} \end{code}
foldl1' was added in GHC 6.4
\begin{code}
#if __GLASGOW_HASKELL__ < 604
foldl1' :: (a -> a -> a) -> [a] -> a
foldl1' f (x:xs) = foldl' f x xs
foldl1' _ [] = panic "foldl1'"
#endif
\end{code}
%************************************************************************ %************************************************************************
%* * %* *
\subsubsection[Utils-Carsten-mergesort]{A mergesort from Carsten} \subsubsection[Utils-Carsten-mergesort]{A mergesort from Carsten}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment