EdisonCore 1.3.3 → 1.3.3.1
raw patch · 11 files changed
+49/−43 lines, 11 filesdep −mtldep ~basenew-uploaderPVP ok
version bump matches the API change (PVP)
Dependencies removed: mtl
Dependency ranges changed: base
API changes (from Hackage documentation)
Files
- CHANGES +4/−0
- EdisonCore.cabal +1/−2
- src/Data/Edison/Assoc/PatriciaLoMap.hs +28/−25
- src/Data/Edison/Assoc/TernaryTrie.hs +3/−3
- src/Data/Edison/Coll/EnumSet.hs +7/−7
- src/Data/Edison/Seq/BankersQueue.hs +1/−1
- src/Data/Edison/Seq/BraunSeq.hs +1/−1
- src/Data/Edison/Seq/Defaults.hs +1/−1
- src/Data/Edison/Seq/FingerSeq.hs +1/−1
- src/Data/Edison/Seq/MyersStack.hs +1/−1
- src/Data/Edison/Seq/RandList.hs +1/−1
CHANGES view
@@ -1,3 +1,7 @@+Changes in 1.3.3.1+ * Remove mtl dependency (removed unnecessary imports which were incompatible with mtl 2.3)+ * Fix implementation of little-endian PatriciaTrees+ Changes in 1.3.3 * Updates to handle MonadFail changes in GHC 8.x * Updates to fix compile issues in GHC 9
EdisonCore.cabal view
@@ -1,7 +1,7 @@ Name: EdisonCore Cabal-Version: >= 1.10 Build-Type: Simple-Version: 1.3.3+Version: 1.3.3.1 License: MIT License-File: COPYRIGHT Author: Chris Okasaki@@ -55,7 +55,6 @@ Data.Edison.Seq.SizedSeq Build-Depends: base == 4.*,- mtl, QuickCheck >= 2.8.2 && < 3, EdisonAPI >= 1.3.3 && < 1.4, containers,
src/Data/Edison/Assoc/PatriciaLoMap.hs view
@@ -121,7 +121,7 @@ rmakeB _ _ t E = t rmakeB p m t0 t1 = B p m t0 t1 -lowestBit :: Int32 -> Int32+lowestBit :: Word -> Word lowestBit x = x .&. (-x) branchingBit :: Int -> Int -> Int@@ -129,10 +129,13 @@ fromIntegral (lowestBit (fromIntegral p0 `xor` fromIntegral p1)) mask :: Int -> Int -> Int-mask p m = fromIntegral (fromIntegral p .&. (fromIntegral m - (1 :: Int32)))+mask p m = fromIntegral (fromIntegral p .&. (fromIntegral m - (1 :: Word))) +shorter :: Int -> Int -> Bool+shorter m n = fromIntegral m < (fromIntegral n :: Word)+ zeroBit :: Int -> Int -> Bool-zeroBit p m = (fromIntegral p) .&. (fromIntegral m) == (0 :: Int32)+zeroBit p m = (fromIntegral p) .&. (fromIntegral m) == (0 :: Word) matchPrefix :: Int -> Int -> Int -> Bool matchPrefix k p m = mask k m == p@@ -168,11 +171,11 @@ union :: FM a -> FM a -> FM a union s@(B p m s0 s1) t@(B q n t0 t1)- | m < n = if matchPrefix q p m then+ | shorter m n = if matchPrefix q p m then if zeroBit q m then B p m (union s0 t) s1 else B p m s0 (union s1 t) else join p s q t- | m > n = if matchPrefix p q n then+ | shorter n m = if matchPrefix p q n then if zeroBit p n then B q n (union s t0) t1 else B q n t0 (union s t1) else join p s q t@@ -320,11 +323,11 @@ unionl :: FM a -> FM a -> FM a unionl s@(B p m s0 s1) t@(B q n t0 t1)- | m < n = if matchPrefix q p m then+ | shorter m n = if matchPrefix q p m then if zeroBit q m then B p m (unionl s0 t) s1 else B p m s0 (unionl s1 t) else join p s q t- | m > n = if matchPrefix p q n then+ | shorter n m = if matchPrefix p q n then if zeroBit p n then B q n (unionl s t0) t1 else B q n t0 (unionl s t1) else join p s q t@@ -341,11 +344,11 @@ unionr :: FM a -> FM a -> FM a unionr s@(B p m s0 s1) t@(B q n t0 t1)- | m < n = if matchPrefix q p m then+ | shorter m n = if matchPrefix q p m then if zeroBit q m then B p m (unionr s0 t) s1 else B p m s0 (unionr s1 t) else join p s q t- | m > n = if matchPrefix p q n then+ | shorter n m = if matchPrefix p q n then if zeroBit p n then B q n (unionr s t0) t1 else B q n t0 (unionr s t1) else join p s q t@@ -362,11 +365,11 @@ unionWith :: (a -> a -> a) -> FM a -> FM a -> FM a unionWith f s@(B p m s0 s1) t@(B q n t0 t1)- | m < n = if matchPrefix q p m then+ | shorter m n = if matchPrefix q p m then if zeroBit q m then B p m (unionWith f s0 t) s1 else B p m s0 (unionWith f s1 t) else join p s q t- | m > n = if matchPrefix p q n then+ | shorter n m = if matchPrefix p q n then if zeroBit p n then B q n (unionWith f s t0) t1 else B q n t0 (unionWith f s t1) else join p s q t@@ -383,11 +386,11 @@ intersectionWith :: (a -> b -> c) -> FM a -> FM b -> FM c intersectionWith f s@(B p m s0 s1) t@(B q n t0 t1)- | m < n = if matchPrefix q p m then+ | shorter m n = if matchPrefix q p m then if zeroBit q m then intersectionWith f s0 t else intersectionWith f s1 t else E- | m > n = if matchPrefix p q n then+ | shorter n m = if matchPrefix p q n then if zeroBit p n then intersectionWith f s t0 else intersectionWith f s t1 else E@@ -406,11 +409,11 @@ difference :: FM a -> FM b -> FM a difference s@(B p m s0 s1) t@(B q n t0 t1)- | m < n = if matchPrefix q p m then+ | shorter m n = if matchPrefix q p m then if zeroBit q m then lmakeB p m (difference s0 t) s1 else rmakeB p m s0 (difference s1 t) else s- | m > n = if matchPrefix p q n then+ | shorter n m = if matchPrefix p q n then if zeroBit p n then difference s t0 else difference s t1 else s@@ -430,10 +433,10 @@ subset' :: FM t -> FM t1 -> Ordering subset' s@(B p m s0 s1) (B q n t0 t1)- | m < n = GT- | m > n = if matchPrefix p q n then- if zeroBit p n then subset' s t0- else subset' s t1+ | shorter m n = GT+ | shorter n m = if matchPrefix p q n then+ if zeroBit p n then subset' s t0 SG.<> LT+ else subset' s t1 SG.<> LT else GT | otherwise = if p == q then case (subset' s0 t0,subset' s1 t1) of (GT,_) -> GT@@ -449,8 +452,8 @@ subset :: FM a -> FM b -> Bool subset s@(B p m s0 s1) (B q n t0 t1)- | m < n = False- | m > n = matchPrefix p q n && (if zeroBit p n then subset s t0+ | shorter m n = False+ | shorter n m = matchPrefix p q n && (if zeroBit p n then subset s t0 else subset s t1) | otherwise = (p == q) && subset s0 t0 && subset s1 t1 subset (B _ _ _ _) _ = False@@ -507,11 +510,11 @@ unionWithKey :: (Int -> a -> a -> a) -> FM a -> FM a -> FM a unionWithKey f s@(B p m s0 s1) t@(B q n t0 t1)- | m < n = if matchPrefix q p m then+ | shorter m n = if matchPrefix q p m then if zeroBit q m then B p m (unionWithKey f s0 t) s1 else B p m s0 (unionWithKey f s1 t) else join p s q t- | m > n = if matchPrefix p q n then+ | shorter n m = if matchPrefix p q n then if zeroBit p n then B q n (unionWithKey f s t0) t1 else B q n t0 (unionWithKey f s t1) else join p s q t@@ -528,11 +531,11 @@ intersectionWithKey :: (Int -> a -> b -> c) -> FM a -> FM b -> FM c intersectionWithKey f s@(B p m s0 s1) t@(B q n t0 t1)- | m < n = if matchPrefix q p m then+ | shorter m n = if matchPrefix q p m then if zeroBit q m then intersectionWithKey f s0 t else intersectionWithKey f s1 t else E- | m > n = if matchPrefix p q n then+ | shorter n m = if matchPrefix p q n then if zeroBit p n then intersectionWithKey f s t0 else intersectionWithKey f s t1 else E
src/Data/Edison/Assoc/TernaryTrie.hs view
@@ -59,7 +59,7 @@ import qualified Data.Edison.Seq as S import qualified Data.List as L import qualified Control.Monad.Fail as Fail-import Control.Monad.Identity+import Control.Monad import Data.Monoid import Data.Semigroup as SG import Data.Maybe (isNothing)@@ -637,7 +637,7 @@ = foldFMB r . foldFMB m . foldMV v . foldFMB l --- FIXME, undestand this code to strictify it+-- FIXME, understand this code to strictify it foldr' = foldr foldl' :: (a -> b -> a) -> a -> FM t b -> a foldl' = foldl@@ -700,7 +700,7 @@ --- FIXME, undestand this code to strictify it+-- FIXME, understand this code to strictify it foldr1' = foldr1 foldl1' :: (b -> b -> b) -> FM k b -> b foldl1' = foldl1
src/Data/Edison/Coll/EnumSet.hs view
@@ -33,7 +33,7 @@ -- > forall x y::A, x < y <==> toEnum x < toEnum y -- -- Derived @Eq@, @Ord@ and @Enum@ instances will fulfill these conditions, if--- the enumerated type has sufficently few constructors.+-- the enumerated type has sufficiently few constructors. {- Copyright (c) 2006, 2008, David F. Place@@ -151,7 +151,7 @@ , toBits , fromBits - -- * Documenation+ -- * Documentation , moduleName ) where @@ -479,7 +479,7 @@ unsafeMapMonotonic = map -- | /O(1)/ Changes the type of the elements in the set without changing--- the representation. Equivalant to @map (toEnum . fromEnum)@, and+-- the representation. Equivalent to @map (toEnum . fromEnum)@, and -- to @(fromBits . toBits)@. This method is operationally a no-op. setCoerce :: (Enum a, Enum b) => Set a -> Set b setCoerce (Set w) = Set w@@ -553,16 +553,16 @@ foldl1 :: (Ord a, Enum a) => (a -> a -> a) -> Set a -> a foldl1 _ (Set 0) = error (moduleName++".foldl1: empty set")-foldl1 f (Set w) = foldlBits folder (toEnum mininum) (clearBit w mininum)+foldl1 f (Set w) = foldlBits folder (toEnum minimum) (clearBit w minimum) where- mininum = lsb w+ minimum = lsb w folder z i = f z (toEnum i) foldl1' :: (Ord a, Enum a) => (a -> a -> a) -> Set a -> a foldl1' _ (Set 0) = error (moduleName++".foldl1': empty set")-foldl1' f (Set w) = foldlBits' folder (toEnum mininum) (clearBit w mininum)+foldl1' f (Set w) = foldlBits' folder (toEnum minimum) (clearBit w minimum) where- mininum = lsb w+ minimum = lsb w folder z i = f z (toEnum i) {--------------------------------------------------------------------
src/Data/Edison/Seq/BankersQueue.hs view
@@ -58,7 +58,7 @@ import Data.Monoid import Data.Semigroup as SG import qualified Control.Monad.Fail as Fail-import Control.Monad.Identity+import Control.Monad import Test.QuickCheck -- signatures for exported functions
src/Data/Edison/Seq/BraunSeq.hs view
@@ -73,7 +73,7 @@ import qualified Control.Applicative as App import qualified Control.Monad.Fail as Fail-import Control.Monad.Identity+import Control.Monad import Data.Maybe import Data.Monoid import Data.Semigroup as SG
src/Data/Edison/Seq/Defaults.hs view
@@ -18,7 +18,7 @@ zip,zip3,zipWith,zipWith3,unzip,unzip3,null) import qualified Control.Monad.Fail as Fail-import Control.Monad.Identity+import Control.Monad import Data.Char (isSpace) import Data.Edison.Prelude ( runFail_ )
src/Data/Edison/Seq/FingerSeq.hs view
@@ -41,7 +41,7 @@ import qualified Data.Edison.Seq as S import Data.Edison.Seq.Defaults import qualified Control.Monad.Fail as Fail-import Control.Monad.Identity+import Control.Monad import Data.Monoid import Data.Semigroup as SG import Test.QuickCheck
src/Data/Edison/Seq/MyersStack.hs view
@@ -53,7 +53,7 @@ import qualified Data.Edison.Seq as S ( Sequence(..) ) import Data.Edison.Seq.Defaults import qualified Control.Monad.Fail as Fail-import Control.Monad.Identity+import Control.Monad import Data.Monoid import Data.Semigroup as SG import Test.QuickCheck
src/Data/Edison/Seq/RandList.hs view
@@ -59,7 +59,7 @@ import qualified Data.Edison.Seq as S( Sequence(..) ) import Data.Edison.Seq.Defaults import qualified Control.Monad.Fail as Fail-import Control.Monad.Identity+import Control.Monad import Data.Monoid import Data.Semigroup as SG import Test.QuickCheck