From: sof Date: Mon, 1 Mar 1999 09:43:37 +0000 (+0000) Subject: [project @ 1999-03-01 09:43:37 by sof] X-Git-Tag: Approximately_9120_patches~6487 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=fbfeeb10e4564e9786f9b5898ddf3536c149bdbc;p=ghc-hetmet.git [project @ 1999-03-01 09:43:37 by sof] Remove unused defns, forall and exists. --- diff --git a/ghc/compiler/utils/Util.lhs b/ghc/compiler/utils/Util.lhs index f99d937..040927e 100644 --- a/ghc/compiler/utils/Util.lhs +++ b/ghc/compiler/utils/Util.lhs @@ -12,7 +12,6 @@ module Util ( Eager, thenEager, returnEager, mapEager, appEager, runEager, -- general list processing - IF_NOT_GHC(forall COMMA exists COMMA) zipEqual, zipWithEqual, zipWith3Equal, zipWith4Equal, zipLazy, stretchZipEqual, mapAndUnzip, mapAndUnzip3, @@ -95,18 +94,6 @@ mapEager f (x:xs) = f x `thenEager` \ y -> %* * %************************************************************************ -Quantifiers are not standard in Haskell. The following fill in the gap. - -\begin{code} -forall :: (a -> Bool) -> [a] -> Bool -forall pred [] = True -forall pred (x:xs) = pred x && forall pred xs - -exists :: (a -> Bool) -> [a] -> Bool -exists pred [] = False -exists pred (x:xs) = pred x || exists pred xs -\end{code} - A paranoid @zip@ (and some @zipWith@ friends) that checks the lists are of equal length. Alastair Reid thinks this should only happen if DEBUGging on; hey, why not? @@ -187,7 +174,7 @@ mapAndUnzip3 f (x:xs) \begin{code} nOfThem :: Int -> a -> [a] -nOfThem n thing = take n (repeat thing) +nOfThem n thing = replicate n thing lengthExceeds :: [a] -> Int -> Bool