uuid 1.0.2 → 1.1.1
raw patch · 3 files changed
+21/−17 lines, 3 filesdep ~base
Dependency ranges changed: base
Files
- Data/UUID.hs +1/−0
- Data/UUID/Internal.hs +17/−4
- uuid.cabal +3/−13
Data/UUID.hs view
@@ -22,6 +22,7 @@ ,null ) where +import Prelude hiding (null) import Data.UUID.Internal -- Everything is really implemented in Data.UUID.Internal,
Data/UUID/Internal.hs view
@@ -12,7 +12,9 @@ module Data.UUID.Internal (UUID(..)+ ,null ,Node(..)+ ,nullNode ,nodeToList ,listToNode ,fromString@@ -22,6 +24,9 @@ ,reserved ) where +import Prelude hiding (null)+import qualified Prelude+ import Data.Word import Data.Char import Data.Maybe@@ -30,10 +35,10 @@ import Data.Typeable -#ifdef BASE_3_SUPPORT -import Data.Generics.Basics-#else+#if MIN_VERSION_base(4,0,0) import Data.Data+#else+import Data.Generics.Basics #endif import Foreign.Ptr@@ -54,7 +59,7 @@ #endif -- |The UUID type. A 'Random' instance is provided which produces--- version 3 UUIDs as specified in RFC 4122. The 'Storable' and +-- version 4 UUIDs as specified in RFC 4122. The 'Storable' and -- 'Binary' instances are compatable with RFC 4122. The 'Binary' -- instance serializes to network byte order. data UUID = UUID@@ -66,6 +71,11 @@ ,uuid_node :: SLOT(Node) } deriving (Eq, Ord, Typeable) +-- |Returns true if the passed-in UUID is the null UUID.+null :: UUID -> Bool+null (UUID 0 0 0 0 0 node) | nullNode node = True+null _ = False+ instance Random UUID where random g = let (timeLow, g1) = randomBoundedIntegral g (timeMid, g2) = randomBoundedIntegral g1@@ -110,6 +120,9 @@ in (Node w1 w2 w3 w4 w5 w6, g6) randomR _ = random -- neglect range +nullNode :: Node -> Bool+nullNode (Node 0 0 0 0 0 0) = True+nullNode _ = False nodeToList :: Node -> [Word8] nodeToList (Node w1 w2 w3 w4 w5 w6) = [w1, w2, w3, w4, w5, w6]
uuid.cabal view
@@ -1,5 +1,5 @@ Name: uuid-Version: 1.0.2+Version: 1.1.1 Copyright: (c) 2008 Antoine Latter Author: Antoine Latter Maintainer: aslatter@gmail.com@@ -8,7 +8,7 @@ Category: Data Build-Type: Simple-Cabal-Version: >= 1.2.3+Cabal-Version: >= 1.6 Description: This library is useful for creating, comparing, parsing and@@ -19,19 +19,9 @@ Homepage: http://community.haskell.org/~aslatter/code/uuid/ -Flag Base3- Default: False- Description: Set when support for base package version 3 is required.- Library Build-Depends: random, binary, bytestring, Crypto, maccatcher,- time-- if flag(Base3)- Build-Depends: base >= 3, base < 4- CPP-Options: -DBASE_3_SUPPORT- else- Build-Depends: base >=4, base < 5+ time, base >=3, base < 5 Exposed-Modules: Data.UUID