on master help sign in
-Wall cleaner
commit9663b9a93b19b42c837e12ce8df8d0b2153460aa authorAntoine Latter <aslatter@gmail.com> dateTue 5 Jan 2010, 03:12 (17 years ago) parent7e1d28b
2 files changed+3−4
Data/UUID/Named.hs−3 Data/UUID/V3.hs+3−1
Data/UUID/Named.hs−3
@@ -33,9 +33,6 @@ import Data.Maybe
3333
3434import qualified Data.ByteString.Lazy as BS
3535
36−import qualified Data.Digest.SHA1 as SHA1
37−
38−
3936-- |Generate a 'UUID' within the specified namespace out of the given
4037-- object.
4138generateNamed :: ([Word8] -> (Word32, Word32, Word32, Word32)) -- ^Hash
Data/UUID/V3.hs+3−1
@@ -48,6 +48,7 @@ hash :: [Word8] -> (Word32, Word32, Word32, Word32)
4848hash bytes
4949 = case map f $ chunk 4 $ MD5.hash bytes of
5050 w1:w2:w3:w4:_ -> (w1, w2, w3, w4)
51+ _ -> error "Data.UUID.V3.hash: fatal error"
5152
5253 where f [b1, b2, b3, b4]
5354 = sum
@@ -56,9 +57,10 @@ hash bytes
5657 , fromIntegral b2 `shiftL` 16
5758 , fromIntegral b1 `shiftL` 24
5859 ]
60+ f _ = error "Data.UUID.V3.hash: fatal error"
5961
6062chunk :: Int -> [a] -> [[a]]
61−chunk n xs = go n [] xs
63+chunk n = go n []
6264 where go _ [] [] = []
6365 go _ ys [] = reverse ys:[]
6466 go 0 ys xs = reverse ys:go n [] xs