on master help sign in
Remove trailing whitespace in all .hs files
commit525b424870d7914cb8994fc8ed22f3497432d124 authorBardur Arantsson <bardur@scientician.net> dateSun 4 Jan 2015, 11:24 (12 years ago) parent3c7224a
10 files changed+16−26
Data/UUID/Builder.hs+3−3 Data/UUID/Internal.hs+7−8 Data/UUID/Util.hs+2−3 Data/UUID/V1.hs+1−4 Data/UUID/V3.hs−1 Data/UUID/V4.hs−1 Data/UUID/V5.hs−1 Data/Word/Util.hs+1−1 Demo.hs−1 tests/BenchUUID.hs+2−3
Data/UUID/Builder.hs+3−3
@@ -10,14 +10,14 @@
1010-- Portability : portable
1111--
1212-- This module provides a system that can call a function that takes
13−-- a sequence of some number of Word8 arguments.
14−--
13+-- a sequence of some number of Word8 arguments.
14+--
1515-- The twist is that the Word8 arguments can be supplied directly
1616-- from Word8s, or from other sources that may provide more than
1717-- one Word8 apiece. Examples are Word16 and Word32 that supply
1818-- two and four Word8s respectively. Other ByteSource instances
1919-- can be defined.
20−--
20+--
2121-- This module is admittedly overkill. There are only three places
2222-- in the uuid package that need to call buildFromBytes with 16
2323-- Word8 values, but each place uses Words of different lengths:
Data/UUID/Internal.hs+7−8
@@ -142,13 +142,13 @@ unpack (UUID w0 w1 w2 w3) =
142142
143143pack :: UnpackedUUID -> UUID
144144pack unpacked =
145− makeFromBytes /-/ (time_low unpacked)
146− /-/ (time_mid unpacked)
147− /-/ (time_hi_and_version unpacked)
148− /-/ (clock_seq_hi_res unpacked)
145+ makeFromBytes /-/ (time_low unpacked)
146+ /-/ (time_mid unpacked)
147+ /-/ (time_hi_and_version unpacked)
148+ /-/ (clock_seq_hi_res unpacked)
149149 /-/ (clock_seq_low unpacked)
150− /-/ (node_0 unpacked) /-/ (node_1 unpacked)
151− /-/ (node_2 unpacked) /-/ (node_3 unpacked)
150+ /-/ (node_0 unpacked) /-/ (node_1 unpacked)
151+ /-/ (node_2 unpacked) /-/ (node_3 unpacked)
152152 /-/ (node_4 unpacked) /-/ (node_5 unpacked)
153153
154154
@@ -509,7 +509,7 @@ instance Storable UUID where
509509
510510instance Binary UUID where
511511 put (UUID w0 w1 w2 w3) =
512− putWord32be w0 >> putWord32be w1 >> putWord32be w2 >> putWord32be w3
512+ putWord32be w0 >> putWord32be w1 >> putWord32be w2 >> putWord32be w3
513513 get = liftM4 UUID getWord32be getWord32be getWord32be getWord32be
514514
515515
@@ -527,4 +527,3 @@ uuidType = mkNoRepType "Data.UUID.UUID"
527527mkNoRepType :: String -> DataType
528528mkNoRepType = mkNorepType
529529#endif
530−
Data/UUID/Util.hs+2−3
@@ -44,11 +44,10 @@ timeAndVersionToTime :: Word16 -> Word16
4444timeAndVersionToTime tv = tv .&. 0x0FFF
4545
4646extractMac :: UUID -> Maybe MAC
47−extractMac uuid =
47+extractMac uuid =
4848 if version uuid == 1
49− then Just $
49+ then Just $
5050 MAC (node_0 unpacked) (node_1 unpacked) (node_2 unpacked) (node_3 unpacked) (node_4 unpacked) (node_5 unpacked)
5151 else Nothing
5252 where
5353 unpacked = unpack uuid
54−
Data/UUID/V1.hs+1−4
@@ -61,7 +61,7 @@ makeUUID time clock mac' =
6161 buildFromBytes 1 /-/ tLow /-/ tMid /-/ tHigh /-/ clock /-/ (MACSource mac')
6262 where tLow = (fromIntegral time) :: Word32
6363 tMid = (fromIntegral (time `shiftR` 32)) :: Word16
64− tHigh = (fromIntegral (time `shiftR` 48)) :: Word16
64+ tHigh = (fromIntegral (time `shiftR` 48)) :: Word16
6565
6666newtype MACSource = MACSource MAC
6767instance ByteSource MACSource where
@@ -133,6 +133,3 @@ hundredsOfNanosSinceGregorianReform t = floor $ 10000000 * dt
133133 where
134134 gregorianReform = UTCTime (fromGregorian 1582 10 15) 0
135135 dt = t `diffUTCTime` gregorianReform
136−
137−
138−
Data/UUID/V3.hs−1
@@ -47,4 +47,3 @@ generateNamed :: UUID -- ^Namespace
4747 -> [Word8] -- ^Object
4848 -> UUID
4949generateNamed = Shared.generateNamed MD5.hash 3
50−
Data/UUID/V4.hs−1
@@ -26,4 +26,3 @@ import qualified System.Random as R
2626-- | Generate a random UUID. Introduced in version 1.2.6.
2727nextRandom :: IO UUID
2828nextRandom = R.randomIO
29−
Data/UUID/V5.hs−1
@@ -42,4 +42,3 @@ generateNamed :: UUID -- ^Namespace
4242 -> [Word8] -- ^Object
4343 -> UUID
4444generateNamed = Shared.generateNamed SHA1.hash 5
45−
Data/Word/Util.hs+1−1
@@ -15,7 +15,7 @@ w8to32 w0s w1s w2s w3s =
1515 w3 = fromIntegral w3s
1616
1717w8to16 :: Word8 -> Word8 -> Word16
18−w8to16 w0s w1s =
18+w8to16 w0s w1s =
1919 (w0 `shiftL` 8) .|. w1
2020 where
2121 w0 = fromIntegral w0s
Demo.hs−1
@@ -13,4 +13,3 @@ main = sequence_ $ replicate count $ do
1313 x <- newUUID
1414 y <- newUUID
1515 seq (x == y) $ return ()
16−
tests/BenchUUID.hs+2−3
@@ -74,7 +74,7 @@ main = do
7474 bench "V5" $ nf (U5.generateNamed U5.namespaceURL) n1
7575 ],
7676 bench "set making" $ nf Set.fromList uuids,
77−
77+
7878 bgroup "storable" [
7979 bench "peek" $ nfIO (peek uuidPtr),
8080 bench "poke" $ poke uuidPtr u1
@@ -83,7 +83,7 @@ main = do
8383
8484-- 50 uuids, so tests can be repeatable
8585uuids :: [U.UUID]
86−uuids
86+uuids
8787 = map (fromJust . U.fromString)
8888 [
8989 "35d42593-1fca-4465-b588-a2e78cb996ba",
@@ -137,4 +137,3 @@ uuids
137137 "8091837c-6456-42c3-a686-f4731a41d4f9",
138138 "2a0e2efb-a11c-4a44-81ee-3efc37379b48"
139139 ]
140−