[commit: ghc] wip/nfs-locking: Add Eq instances. (27bc02e)
git at git.haskell.org
git at git.haskell.org
Thu Oct 26 23:55:34 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/nfs-locking
Link : http://ghc.haskell.org/trac/ghc/changeset/27bc02eb27cefd49c0292a6190b269c5dd2bb4b7/ghc
>---------------------------------------------------------------
commit 27bc02eb27cefd49c0292a6190b269c5dd2bb4b7
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date: Wed Feb 11 03:22:35 2015 +0000
Add Eq instances.
>---------------------------------------------------------------
27bc02eb27cefd49c0292a6190b269c5dd2bb4b7
src/Oracles/Builder.hs | 2 +-
src/Package/Base.hs | 5 +++--
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/Oracles/Builder.hs b/src/Oracles/Builder.hs
index 07b1bbd..d538611 100644
--- a/src/Oracles/Builder.hs
+++ b/src/Oracles/Builder.hs
@@ -29,7 +29,7 @@ data Builder = Ar
| Gcc Stage
| Ghc Stage
| GhcPkg Stage
- deriving Show
+ deriving (Show, Eq)
instance ShowArg Builder where
showArg builder = toStandard <$> do
diff --git a/src/Package/Base.hs b/src/Package/Base.hs
index 40d893e..e3c38e7 100644
--- a/src/Package/Base.hs
+++ b/src/Package/Base.hs
@@ -4,7 +4,6 @@ module Package.Base (
module Ways,
module Util,
module Oracles,
- module Settings,
Package (..), Settings (..), TodoItem (..),
defaultSettings, library, customise, updateSettings,
commonCcArgs, commonLdArgs, commonCppArgs, commonCcWarninigArgs,
@@ -21,7 +20,6 @@ import Base
import Ways
import Util
import Oracles
-import Settings
import qualified System.Directory as S
data Settings = Settings
@@ -72,6 +70,9 @@ data Package = Package
pkgTodo :: [TodoItem] -- [(Stage1, "dist-install", defaultSettings)]
}
+instance Eq Package where
+ (==) = (==) `on` pkgName
+
updateSettings :: (Settings -> Settings) -> Package -> Package
updateSettings update (Package name path cabal todo) =
Package name path cabal (map updateTodo todo)
More information about the ghc-commits
mailing list