summaryrefslogtreecommitdiff
path: root/Types/UUID.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Types/UUID.hs')
-rw-r--r--Types/UUID.hs15
1 files changed, 7 insertions, 8 deletions
diff --git a/Types/UUID.hs b/Types/UUID.hs
index f7232d0b9..767cd0dfe 100644
--- a/Types/UUID.hs
+++ b/Types/UUID.hs
@@ -9,13 +9,12 @@ module Types.UUID where
-- A UUID is either an arbitrary opaque string, or UUID info may be missing.
data UUID = NoUUID | UUID String
- deriving (Eq, Ord)
+ deriving (Eq, Ord, Show)
-instance Show UUID where
- show (UUID u) = u
- show NoUUID = ""
+fromUUID :: UUID -> String
+fromUUID (UUID u) = u
+fromUUID NoUUID = ""
-instance Read UUID where
- readsPrec _ s
- | null s = [(NoUUID, "")]
- | otherwise = [(UUID s, "")]
+toUUID :: String -> UUID
+toUUID [] = NoUUID
+toUUID s = UUID s