X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Futils%2FUtil.lhs;h=b1c93a8a6aa82a2f326df199352789db28e03fbb;hb=432ec49f1fbaefc54f03bc3378f63fbd1e75d44b;hp=7cb7a3de512128da9b4a3a13eccfc65f2cbef133;hpb=aa3f26d12d8df7f1e5c9df6701511e9546d0369f;p=ghc-hetmet.git diff --git a/ghc/compiler/utils/Util.lhs b/ghc/compiler/utils/Util.lhs index 7cb7a3d..b1c93a8 100644 --- a/ghc/compiler/utils/Util.lhs +++ b/ghc/compiler/utils/Util.lhs @@ -41,7 +41,7 @@ module Util ( foldl2, count, -- comparisons - thenCmp, cmpList, prefixMatch, suffixMatch, + eqListBy, thenCmp, cmpList, prefixMatch, suffixMatch, -- strictness foldl', seqList, @@ -52,7 +52,6 @@ module Util ( unzipWith , global - , myGetProcessID #if __GLASGOW_HASKELL__ <= 408 , catchJust @@ -73,9 +72,7 @@ import FastTypes #if __GLASGOW_HASKELL__ <= 408 import Exception ( catchIO, justIoErrors, raiseInThread ) #endif -#ifndef mingw32_TARGET_OS -import Posix -#endif + infixr 9 `thenCmp` \end{code} @@ -642,6 +639,11 @@ count p (x:xs) | p x = 1 + count p xs %************************************************************************ \begin{code} +eqListBy :: (a->a->Bool) -> [a] -> [a] -> Bool +eqListBy eq [] [] = True +eqListBy eq (x:xs) (y:ys) = eq x y && eqListBy eq xs ys +eqListBy eq xs ys = False + thenCmp :: Ordering -> Ordering -> Ordering {-# INLINE thenCmp #-} thenCmp EQ any = any @@ -726,11 +728,4 @@ catchJust = catchIO ioErrors = justIoErrors throwTo = raiseInThread #endif - -#ifdef mingw32_TARGET_OS -foreign import "_getpid" myGetProcessID :: IO Int -#else -myGetProcessID :: IO Int -myGetProcessID = Posix.getProcessID -#endif \end{code}