summaryrefslogtreecommitdiff
path: root/Types/UUID.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-04-15 20:13:35 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-04-15 20:13:35 -0400
commitdc748c7336aea9cbf04c0311098a44c2b329633d (patch)
tree1a993dd9662ff046b74a427232b8e301500a97b8 /Types/UUID.hs
parent60c4bcefd4d3001e7025fc59c1f7ab927a3a5c34 (diff)
reinit: New command that can initialize a new reposotory using the configuration of a previously known repository. Useful if a repository got deleted and you want to clone it back the way it was.
Diffstat (limited to 'Types/UUID.hs')
-rw-r--r--Types/UUID.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/Types/UUID.hs b/Types/UUID.hs
index 8a304dffa..df3884059 100644
--- a/Types/UUID.hs
+++ b/Types/UUID.hs
@@ -8,6 +8,8 @@
module Types.UUID where
import qualified Data.Map as M
+import qualified Data.UUID as U
+import Data.Maybe
-- A UUID is either an arbitrary opaque string, or UUID info may be missing.
data UUID = NoUUID | UUID String
@@ -21,4 +23,7 @@ toUUID :: String -> UUID
toUUID [] = NoUUID
toUUID s = UUID s
+isUUID :: String -> Bool
+isUUID = isJust . U.fromString
+
type UUIDMap = M.Map UUID String