[commit: ghc] wip/nfs-locking: Use Data.Bifunctor.bimap as it is now available on bootstrapping GHC. (cbbbc63)

git at git.haskell.org git at git.haskell.org
Fri Oct 27 00:21:36 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/nfs-locking
Link       : http://ghc.haskell.org/trac/ghc/changeset/cbbbc63883b41b794d154efbb7a166ea659980db/ghc

>---------------------------------------------------------------

commit cbbbc63883b41b794d154efbb7a166ea659980db
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date:   Wed Feb 17 01:59:11 2016 +0000

    Use Data.Bifunctor.bimap as it is now available on bootstrapping GHC.


>---------------------------------------------------------------

cbbbc63883b41b794d154efbb7a166ea659980db
 src/Base.hs | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/src/Base.hs b/src/Base.hs
index 769fdc4..7d63fa0 100644
--- a/src/Base.hs
+++ b/src/Base.hs
@@ -3,6 +3,7 @@ module Base (
     -- * General utilities
     module Control.Applicative,
     module Control.Monad.Extra,
+    module Data.Bifunctor,
     module Data.Function,
     module Data.List.Extra,
     module Data.Maybe,
@@ -22,7 +23,7 @@ module Base (
     putColoured, putOracle, putBuild, putSuccess, putError,
 
     -- * Miscellaneous utilities
-    bimap, minusOrd, intersectOrd, replaceEq, quote, replaceSeparators,
+    minusOrd, intersectOrd, replaceEq, quote, replaceSeparators,
     decodeModule, encodeModule, unifyPath, (-/-), versionToInt,
     removeFileIfExists, removeDirectoryIfExists, matchVersionedFilePath
     ) where
@@ -30,6 +31,7 @@ module Base (
 import Control.Applicative
 import Control.Monad.Extra
 import Control.Monad.Reader
+import Data.Bifunctor
 import Data.Char
 import Data.Function
 import Data.List.Extra
@@ -142,11 +144,6 @@ putError msg = do
     putColoured Red msg
     error $ "GHC build system error: " ++ msg
 
--- Explicit definition to avoid dependency on Data.Bifunctor
--- | Bifunctor bimap.
-bimap :: (a -> b) -> (c -> d) -> (a, c) -> (b, d)
-bimap f g (x, y) = (f x, g y)
-
 -- Explicit definition to avoid dependency on Data.List.Ordered
 -- | Difference of two ordered lists.
 minusOrd :: Ord a => [a] -> [a] -> [a]



More information about the ghc-commits mailing list