on master help sign in
whitespace only (courtesy of stylish haskell)
5ff4e67Herbert Valerio Riedel
uuid-types/Data/UUID/Types/Internal.hs+60−60
@@ -1,4 +1,7 @@
1+{-# LANGUAGE CPP #-}
1−{-# LANGUAGE DeriveDataTypeable, TypeFamilies, CPP, ViewPatterns #-}
2+{-# LANGUAGE DeriveDataTypeable #-}
3+{-# LANGUAGE TypeFamilies #-}
4+{-# LANGUAGE ViewPatterns #-}
2{-# OPTIONS_HADDOCK hide #-}
5{-# OPTIONS_HADDOCK hide #-}
3
6
4-- |
7-- |
@@ -13,72 +16,69 @@
13-- Portability : portable
16-- Portability : portable
14
17
15module Data.UUID.Types.Internal
18module Data.UUID.Types.Internal
16− (UUID(..)
19+ ( UUID(..)
17− ,null
20+ , null
18− ,nil
21+ , nil
19− ,fromByteString
22+ , fromByteString
20− ,toByteString
23+ , toByteString
21− ,fromString
24+ , fromString
22− ,toString
25+ , toString
23− ,fromText
26+ , fromText
24− ,toText
27+ , toText
25− ,fromWords
28+ , fromWords
26− ,toWords
29+ , toWords
27− ,toList
30+ , toList
28− ,buildFromBytes
31+ , buildFromBytes
29− ,buildFromWords
32+ , buildFromWords
30− ,fromASCIIBytes
33+ , fromASCIIBytes
31− ,toASCIIBytes
34+ , toASCIIBytes
32− ,fromLazyASCIIBytes
35+ , fromLazyASCIIBytes
33− ,toLazyASCIIBytes
36+ , toLazyASCIIBytes
34− ,UnpackedUUID(..)
37+ , UnpackedUUID(..)
35− ,pack
38+ , pack
36− ,unpack
39+ , unpack
37 ) where
40 ) where
38
41
39−import Prelude hiding (null)
42+import Prelude hiding (null)
40
43
41−import Control.Applicative ((<*>))
44+import Control.Applicative ((<*>))
42−import Control.DeepSeq (NFData(..))
45+import Control.DeepSeq (NFData (..))
43−import Control.Monad (liftM2, guard)
46+import Control.Monad (guard, liftM2)
47+import Data.Bits
48+import Data.Char
44−import Data.Functor ((<$>))
49+import Data.Functor ((<$>))
45−import Data.Char
46−import Data.Bits
47−import Data.Hashable
50+import Data.Hashable
48−import Data.List (elemIndices)
51+import Data.List (elemIndices)
49−import Foreign.Ptr (Ptr)
52+import Foreign.Ptr (Ptr)
50
53
51#if MIN_VERSION_base(4,0,0)
54#if MIN_VERSION_base(4,0,0)
52−import Data.Data
55+import Data.Data
53#else
56#else
54−import Data.Generics.Basics
57+import Data.Generics.Basics
55#endif
58#endif
56
59
57−import Foreign.Storable
60+import Foreign.Storable
58
61
62+import Data.Binary
59−import Data.Binary
63+import Data.Binary.Get
60−import Data.Binary.Put
64+import Data.Binary.Put
61−import Data.Binary.Get
62−import qualified Data.ByteString as B
65+import qualified Data.ByteString as B
63−import qualified Data.ByteString.Internal as BI
66+import qualified Data.ByteString.Internal as BI
64−import qualified Data.ByteString.Lazy as BL
67+import qualified Data.ByteString.Lazy as BL
65−import qualified Data.ByteString.Unsafe as BU
68+import qualified Data.ByteString.Unsafe as BU
66−import Data.Text (Text)
69+import Data.Text (Text)
67−import qualified Data.Text as T
70+import qualified Data.Text as T
68
71
69−import Data.UUID.Types.Internal.Builder
72+import Data.UUID.Types.Internal.Builder
70
73
71−import System.Random
74+import System.Random
72
75
73
76
74-- |The UUID type. A 'Random' instance is provided which produces
77-- |The UUID type. A 'Random' instance is provided which produces
75-- insecure version 4 UUIDs as specified in RFC 4122. The 'Storable' and
78-- insecure version 4 UUIDs as specified in RFC 4122. The 'Storable' and
76-- 'Binary' instances are compatible with RFC 4122, storing the fields in
79-- 'Binary' instances are compatible with RFC 4122, storing the fields in
77-- network order as 16 bytes.
80-- network order as 16 bytes.
78−data UUID
79− = UUID
80− {-# UNPACK #-} !Word64
81+data UUID = UUID {-# UNPACK #-} !Word64 {-# UNPACK #-} !Word64
81− {-# UNPACK #-} !Word64
82 deriving (Eq, Ord, Typeable)
82 deriving (Eq, Ord, Typeable)
83{-
83{-
84 Prior to uuid-types-1.0.4:
84 Prior to uuid-types-1.0.4:
@@ -115,17 +115,17 @@ fromWords w1 w2 w3 w4 = UUID (w32to64 w1 w2) (w32to64 w3 w4)
115
115
116data UnpackedUUID =
116data UnpackedUUID =
117 UnpackedUUID {
117 UnpackedUUID {
118− time_low :: Word32 -- 0-3
118+ time_low :: Word32 -- 0-3
119− , time_mid :: Word16 -- 4-5
119+ , time_mid :: Word16 -- 4-5
120 , time_hi_and_version :: Word16 -- 6-7
120 , time_hi_and_version :: Word16 -- 6-7
121− , clock_seq_hi_res :: Word8 -- 8
121+ , clock_seq_hi_res :: Word8 -- 8
122− , clock_seq_low :: Word8 -- 9
122+ , clock_seq_low :: Word8 -- 9
123− , node_0 :: Word8
123+ , node_0 :: Word8
124− , node_1 :: Word8
124+ , node_1 :: Word8
125− , node_2 :: Word8
125+ , node_2 :: Word8
126− , node_3 :: Word8
126+ , node_3 :: Word8
127− , node_4 :: Word8
127+ , node_4 :: Word8
128− , node_5 :: Word8
128+ , node_5 :: Word8
129 }
129 }
130 deriving (Read, Show, Eq, Ord)
130 deriving (Read, Show, Eq, Ord)
131
131