summaryrefslogtreecommitdiff
path: root/Types/UUID.hs
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2014-04-15 20:13:35 -0400
committerJoey Hess <joey@kitenet.net>2014-04-15 20:13:35 -0400
commit915d038becd92cf1368c6ec8b9db9d13b8743786 (patch)
treeb4048e29acd05aa612a2e83da8e7b9710e7c4e9d /Types/UUID.hs
parent162565d92830a145f66c6a1fa65be26973726064 (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 8a304dffab..df38840598 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