From c2eba63d11c748aeebdd3a4a3a5b015ac5e2f2c9 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 16 Aug 2016 16:59:25 -0400 Subject: add cost estimates --- Types/Cost.hs | 4 ++-- Types/UI.hs | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'Types') diff --git a/Types/Cost.hs b/Types/Cost.hs index 290fa25..2f181a2 100644 --- a/Types/Cost.hs +++ b/Types/Cost.hs @@ -12,13 +12,13 @@ import Utility.HumanTime -- | An estimated cost to perform an operation. data Cost op = CPUCost Seconds -- ^ using 1 CPU core - deriving (Show) + deriving (Show, Eq, Ord) unknownCost :: Cost op unknownCost = CPUCost (Seconds 0) newtype Seconds = Seconds Integer - deriving (Num) + deriving (Num, Eq, Ord) instance Show Seconds where show (Seconds n) = fromDuration (Duration n) diff --git a/Types/UI.hs b/Types/UI.hs index 67b4c5f..0a0c789 100644 --- a/Types/UI.hs +++ b/Types/UI.hs @@ -10,7 +10,7 @@ import Types data UI = UI { isAvailable :: IO Bool , showError :: Desc -> IO () - , promptQuestion :: Title -> Desc -> IO Bool + , promptQuestion :: Title -> Desc -> Question -> IO Bool , promptName :: Title -> Desc -> Name -> (Name -> Maybe Problem) -> IO (Maybe Name) , promptPassword :: Bool -> Title -> Desc -> IO (Maybe Password) , promptKeyId :: Title -> Desc -> [(Name, KeyId)] -> IO (Maybe KeyId) @@ -21,3 +21,4 @@ type Title = String type Desc = String type Percent = Int type Problem = String +type Question = String -- cgit v1.2.3