diff options
author | Joey Hess <joey@kitenet.net> | 2011-03-30 14:00:54 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-03-30 14:00:54 -0400 |
commit | 619f07ee6a0ad875f365886096b112b6c18b0606 (patch) | |
tree | 4b2de6c0657b6d46fff477982d3bc78c2c8ccc4c /RemoteClass.hs | |
parent | a47ed922e1302480d79f54f553532e85eebae872 (diff) |
boilerplate reduction
Diffstat (limited to 'RemoteClass.hs')
-rw-r--r-- | RemoteClass.hs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/RemoteClass.hs b/RemoteClass.hs index de4c281f4..43bf403de 100644 --- a/RemoteClass.hs +++ b/RemoteClass.hs @@ -15,6 +15,8 @@ import Data.Map as M import qualified GitRepo as Git import Key +type Cost = Int + {- There are different types of remotes. -} data RemoteType a = RemoteType { -- human visible type name @@ -22,7 +24,7 @@ data RemoteType a = RemoteType { -- enumerates remotes of this type enumerate :: a [Git.Repo], -- generates a remote of this type - generate :: Git.Repo -> Maybe (M.Map String String) -> a (Remote a), + generate :: Git.Repo -> String -> Cost -> Maybe (M.Map String String) -> a (Remote a), -- initializes or changes a remote setup :: String -> M.Map String String -> a (M.Map String String) } @@ -34,7 +36,7 @@ data Remote a = Remote { -- each Remote has a human visible name name :: String, -- Remotes have a use cost; higher is more expensive - cost :: Int, + cost :: Cost, -- Transfers a key to the remote. storeKey :: Key -> a Bool, -- retrieves a key's contents to a file |