[commit: ghc] wip/nfs-locking: Clean up. (2e29ea9)

git at git.haskell.org git at git.haskell.org
Thu Oct 26 23:50:00 UTC 2017


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

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

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

commit 2e29ea968bba4737bbdeb914e90cae4933202c75
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date:   Mon Jan 12 00:29:28 2015 +0000

    Clean up.


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

2e29ea968bba4737bbdeb914e90cae4933202c75
 src/Oracles/Base.hs |  3 ++-
 src/Oracles/Flag.hs | 10 +++++-----
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/src/Oracles/Base.hs b/src/Oracles/Base.hs
index f9e5c73..c9827a9 100644
--- a/src/Oracles/Base.hs
+++ b/src/Oracles/Base.hs
@@ -8,7 +8,8 @@ module Oracles.Base (
 import Base
 import Development.Shake.Classes
 
-newtype ConfigKey = ConfigKey String deriving (Show, Typeable, Eq, Hashable, Binary, NFData)
+newtype ConfigKey = ConfigKey String
+    deriving (Show, Typeable, Eq, Hashable, Binary, NFData)
 
 askConfigWithDefault :: String -> Action String -> Action String
 askConfigWithDefault key defaultAction = do
diff --git a/src/Oracles/Flag.hs b/src/Oracles/Flag.hs
index 7a235a4..b93e4ab 100644
--- a/src/Oracles/Flag.hs
+++ b/src/Oracles/Flag.hs
@@ -81,11 +81,11 @@ instance Not Bool where
 
 instance Not Condition where
     type NotResult Condition = Condition
-    not x = not <$> (toCondition x)
+    not = fmap not
 
 instance Not Flag where
     type NotResult Flag = Condition
-    not x = not (toCondition x)
+    not = not . toCondition
 
 class AndOr a b where
     type AndOrResult a b
@@ -102,12 +102,12 @@ instance AndOr Bool Bool where
 
 instance ToCondition a => AndOr Condition a where
     type AndOrResult Condition a = Condition
-    x && y = (Prelude.&&) <$> toCondition x <*> toCondition y
-    x || y = (Prelude.||) <$> toCondition x <*> toCondition y
+    x && y = (&&) <$> x <*> toCondition y
+    x || y = (||) <$> x <*> toCondition y
 
 instance ToCondition a => AndOr Flag a where
     type AndOrResult Flag a = Condition
     x && y = toCondition x && y
     x || y = toCondition x || y
 
--- TODO: need one more instance?
\ No newline at end of file
+-- TODO: need more instances to handle Bool as first argument of (&&), (||)



More information about the ghc-commits mailing list