packages feed

representable-tries 3.0 → 3.0.1

raw patch · 2 files changed

+8/−8 lines, 2 filesdep ~adjunctionsdep ~basedep ~keys

Dependency ranges changed: adjunctions, base, keys, representable-functors

Files

representable-tries.cabal view
@@ -1,6 +1,6 @@ name:          representable-tries category:      Data Structures, Functors, Monads, Comonads-version:       3.0+version:       3.0.1 license:       BSD3 cabal-version: >= 1.6 license-file:  LICENSE@@ -36,17 +36,17 @@     UndecidableInstances    build-depends:-    adjunctions            == 3.0.*,+    adjunctions            >= 3.0.0.1 && < 3.1,     base                   >= 4       && < 5,     bifunctors             == 3.0.*,     comonad                == 3.0.*,     comonad-transformers   == 3.0.*,     containers             >= 0.3     && < 0.6,     distributive           >= 0.2.2   && < 0.3,-    keys                   == 3.0.*,+    keys                   >= 3.0.0.1 && < 3.1,     mtl                    >= 2.0.1   && < 2.2,     transformers           >= 0.2     && < 0.4,-    representable-functors == 3.0.*,+    representable-functors >= 3.0.0.1 && < 3.1,     semigroups             >= 0.8.3.1 && < 0.9,     semigroupoids          == 3.0.* 
src/Data/Functor/Representable/Trie.hs view
@@ -301,7 +301,7 @@   -- | Extract bits in little-endian order-bits :: Bits t => t -> [Bool]+bits :: (Num t, Bits t) => t -> [Bool] bits 0 = [] bits x = testBit x 0 : bits (shiftR x 1) @@ -311,17 +311,17 @@ unbit True  = 1  -- | Bit list to value-unbits :: Bits t => [Bool] -> t+unbits :: (Num t, Bits t) => [Bool] -> t unbits [] = 0 unbits (x:xs) = unbit x .|. shiftL (unbits xs) 1 -unbitsZ :: (Bits n) => (Bool,[Bool]) -> n+unbitsZ :: (Num n, Bits n) => (Bool,[Bool]) -> n unbitsZ (positive,bs) = sig (unbits bs)  where    sig | positive  = id        | otherwise = negate -bitsZ :: (Ord n, Bits n) => n -> (Bool,[Bool])+bitsZ :: (Ord n, Num n, Bits n) => n -> (Bool,[Bool]) bitsZ = (>= 0) &&& (bits . abs)  -- TODO: fix the show instance of this