Commit 2e29ea96 authored by Andrey Mokhov's avatar Andrey Mokhov
Browse files

Clean up.

parent 238efc2b
......@@ -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
......
......@@ -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 (&&), (||)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment