diff options
Diffstat (limited to 'Types')
-rw-r--r-- | Types/Cost.hs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/Types/Cost.hs b/Types/Cost.hs index a6a1160..290fa25 100644 --- a/Types/Cost.hs +++ b/Types/Cost.hs @@ -12,8 +12,6 @@ import Utility.HumanTime -- | An estimated cost to perform an operation. data Cost op = CPUCost Seconds -- ^ using 1 CPU core - | GPUCost Seconds - | CombinedCost (Cost op) (Cost op) deriving (Show) unknownCost :: Cost op @@ -32,9 +30,9 @@ instance Monoid (Cost t) where mempty = CPUCost (Seconds 0) CPUCost (Seconds a) `mappend` CPUCost (Seconds b) = CPUCost (Seconds (a+b)) - GPUCost (Seconds a) `mappend` GPUCost (Seconds b) = - GPUCost (Seconds (a+b)) - a `mappend` b = CombinedCost a b + +mapCost :: (Integer -> Integer) -> Cost op -> Cost op +mapCost f (CPUCost (Seconds n)) = CPUCost (Seconds (f n)) -- | Operations whose cost can be measured. data DecryptionOp |