on master help sign in
Call out random instance with its own module
commitdf517b3b1630d816247530574a82c63de16cb6e8 authorAntoine Latter <aslatter@gmail.com> dateThu 14 Jun 2012, 02:04 (14 years ago) parent678c66f
2 files changed+29
Data/UUID/V4.hs+28 uuid.cabal+1
Data/UUID/V4.hsnew file+28
@@ -0,0 +1,28 @@
1+{- |
2+ Module : Data.UUID.V4
3+ Copyright : (c) 2012 Antoine Latter
4+
5+ License : BSD-style
6+
7+ Maintainer : aslatter@gmail.com
8+ Stability : experimental
9+ Portability : portable
10+
11+ This module implements Version 4 UUIDs as specified
12+ in RFC 4122.
13+
14+ These UUIDs are generated from a psuedo-random generator.
15+ We use the System.Random 'R.StdGen' as our random source.
16+
17+ All of the logic is encapsulated in the 'R.Random' instance
18+ for the UUID type, so you are free to use the random generator
19+ of your choice.
20+-}
21+module Data.UUID.V4 (nextRandom) where
22+
23+import Data.UUID
24+import qualified System.Random as R
25+
26+nextRandom :: IO UUID
27+nextRandom = R.randomIO
28+
uuid.cabal+1
@@ -33,6 +33,7 @@ Library
3333 Data.UUID
3434 Data.UUID.V1
3535 Data.UUID.V3
36+ Data.UUID.V4
3637 Data.UUID.V5
3738
3839 Other-Modules: