data-dword 0.3.1 → 0.3.1.1
raw patch · 3 files changed
+26/−20 lines, 3 filesdep ~data-bworddep ~hashabledep ~template-haskellPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: data-bword, hashable, template-haskell
API changes (from Hackage documentation)
Files
- README.md +3/−0
- data-dword.cabal +3/−2
- src/Data/DoubleWord/TH.hs +20/−18
README.md view
@@ -1,5 +1,8 @@ Data-DWord ==========++[](https://travis-ci.org/mvv/data-dword) [](http://hackage.haskell.org/package/data-dword)+ This package provides Template Haskell utilities for declaring fixed-length binary word data types. Signed and unsigned 96, 128, 160, 192, 224, and 256-bit types are predefined.
data-dword.cabal view
@@ -1,5 +1,5 @@ Name: data-dword-Version: 0.3.1+Version: 0.3.1.1 Category: Data Stability: experimental Synopsis: Stick two binary words together to get a bigger one@@ -20,6 +20,8 @@ Extra-Source-Files: README.md +Tested-With: GHC==7.6.3, GHC==7.8.4, GHC==7.10.3, GHC==8.0.1, GHC==8.2.1+ Cabal-Version: >= 1.10.0 Build-Type: Simple @@ -56,4 +58,3 @@ Main-Is: Tests.hs Other-Modules: Types-
src/Data/DoubleWord/TH.hs view
@@ -106,7 +106,9 @@ Nothing #endif [NormalC cn [(hiS, hiT), (loS, loT)]]-#if MIN_VERSION_template_haskell(2,11,0)+#if MIN_VERSION_template_haskell(2,12,0)+ [DerivClause Nothing (map ConT ad)]+#elif MIN_VERSION_template_haskell(2,11,0) (ConT <$> ad) #else ad@@ -222,9 +224,9 @@ {- enumFrom x = enumFromTo x maxBound -} , funX 'enumFrom $ appVN 'enumFromTo [x, 'maxBound] , inline 'enumFrom- {- + {- enumFromThen x y =- enumFromThenTo x y $ if y >= x then maxBound else minBound + enumFromThenTo x y $ if y >= x then maxBound else minBound -} , funXY 'enumFromThen $ appV 'enumFromThenTo@@ -241,7 +243,7 @@ where down to c = next : if next == to then [] else down to next where next = c - 1 up to c = next : if next == to then [] else up to next- where next = c + 1 + where next = c + 1 -} , FunD 'enumFromTo $ return $ Clause@@ -283,14 +285,14 @@ (NormalB $ appVN '(+) [c, 'lsb]) []] ] {-- enumFromThenTo x y z = case y `compare` x of + enumFromThenTo x y z = case y `compare` x of LT → if z > x then [] else down (x - y) z x EQ → repeat x GT → if z < x then [] else up (y - x) z x where down s to c = c : if next < to then [] else down s to next where next = c - s up s to c = c : if next > to then [] else up s to next- where next = c + s + where next = c + s -} , FunD 'enumFromThenTo $ return $ Clause [VarP x, VarP y, VarP z]@@ -341,9 +343,9 @@ (appW [ appV 'negate [appVN '(+) ['lsb, hi]] , appVN 'negate [lo] ]) , inlinable 'negate- {- + {- abs x = if SIGNED- then if x < 0 then negate x else x + then if x < 0 then negate x else x else x -} , funX 'abs $@@ -458,7 +460,7 @@ GT | lo' == 0 → (W 0 (fromIntegral t2), W (fromIntegral t1) lo) where (t2, t1) = quotRem hi hi'- GT | hi' == 0 && lo' == maxBound → + GT | hi' == 0 && lo' == maxBound → if t2 == 0 then if t1 == maxBound then (W 0 z + 1, 0)@@ -499,7 +501,7 @@ then (q1 - 2, t9 - t5) else (q1 - 2, (maxBound - t5) + t9 + 1) else- (q1 - 1, (maxBound - t5) + t7 + 1) + (q1 - 1, (maxBound - t5) + t7 + 1) else (q1, t6 - t5) where div1 hhh hll by = go hhh hll 0@@ -617,7 +619,7 @@ (CondE (appVN '(==) [t1, 'maxBound]) (TupE [ appV '(+)- [ appWN ['allZeroes, z] + [ appWN ['allZeroes, z] , oneE ] , zeroE ]) (TupE@@ -663,7 +665,7 @@ , appV '(-) [hiSizeE, VarE t2] ] , ValD (ConP cn [VarP hhh, VarP hll])- (NormalB $ appVN 'shiftL [x, t2]) [] + (NormalB $ appVN 'shiftL [x, t2]) [] , ValD (AsP v $ ConP cn [VarP lhh, VarP lll]) (NormalB $ appVN 'shiftL [y, t2]) [] , ValD (TupP [ TupP [LitP (IntegerL 0), VarP q1]@@ -798,7 +800,7 @@ if r == 0 then (q1, r1) else (q1 - 1, r1 + y)- else + else if y < 0 then let (q, r) = quotRem (unsignedWord x) (negate $ unsignedWord y)@@ -992,7 +994,7 @@ funXY 'rotateL $ appV 'signedWord [appV 'rotateL [appVN 'unsignedWord [x], VarE y]]- else + else funHiLoX' 'rotateL (CondE (appV '(>=) [VarE y, litI 0]) (appW@@ -1089,7 +1091,7 @@ if signed then [inline 'rotateL] else [] #if MIN_VERSION_base(4,7,0) , inst ''FiniteBits [tp]- {- + {- finiteBitSize = finiteBitSize (undefined ∷ H) + finiteBitSize (undefined ∷ L) -}@@ -1113,7 +1115,7 @@ {- UNSIGNED: unsignedWord = id- + SIGNED: unsignedWord (W hi lo) = U (unsignedWord hi) lo -}@@ -1127,7 +1129,7 @@ {- UNSIGNED: signedWord (W hi lo) = S (signedWord hi) lo- + SIGNED: signedWord = id -}@@ -1141,7 +1143,7 @@ {- UNSIGNED: unwrappedAdd (W hi lo) (W hi' lo') = (W 0 z, W y x)- where (t1, x) = unwrappedAdd lo lo' + where (t1, x) = unwrappedAdd lo lo' (t3, t2) = unwrappedAdd hi (fromIntegral t1) (t4, y) = unwrappedAdd t2 hi' z = fromIntegral $ t3 + t4