fingertree 0.1.5.0 → 0.1.6.0
raw patch · 6 files changed
+65/−12 lines, 6 filesdep +deepseq
Dependencies added: deepseq
Files
- Data/FingerTree.hs +26/−0
- Data/IntervalMap/FingerTree.hs +16/−2
- Data/PriorityQueue/FingerTree.hs +13/−3
- changelog +4/−0
- fingertree.cabal +6/−4
- tests/ft-properties.hs +0/−3
Data/FingerTree.hs view
@@ -12,6 +12,9 @@ #if __GLASGOW_HASKELL__ >= 710 && __GLASGOW_HASKELL__ < 802 {-# LANGUAGE AutoDeriveTypeable #-} #endif+#if __GLASGOW_HASKELL__ >= 710+{-# LANGUAGE DeriveAnyClass #-}+#endif ----------------------------------------------------------------------------- -- | -- Module : Data.FingerTree@@ -92,6 +95,7 @@ #if (MIN_VERSION_base(4,9,0)) && !(MIN_VERSION_base(4,11,0)) import Data.Semigroup #endif+import Control.DeepSeq import Data.Foldable (toList) infixr 5 ><@@ -105,7 +109,10 @@ deriving (Eq, Ord, Show, Read #if __GLASGOW_HASKELL__ >= 706 , Generic+#if __GLASGOW_HASKELL__ >= 710+ , NFData #endif+#endif ) -- | View of the right end of a sequence.@@ -116,7 +123,10 @@ deriving (Eq, Ord, Show, Read #if __GLASGOW_HASKELL__ >= 706 , Generic+#if __GLASGOW_HASKELL__ >= 710+ , NFData #endif+#endif ) instance (Functor s) => Functor (ViewL s) where@@ -149,7 +159,10 @@ deriving (Show #if __GLASGOW_HASKELL__ >= 706 , Generic+#if __GLASGOW_HASKELL__ >= 710+ , NFData #endif+#endif ) instance Foldable Digit where@@ -177,7 +190,10 @@ deriving (Show #if __GLASGOW_HASKELL__ >= 706 , Generic+#if __GLASGOW_HASKELL__ >= 710+ , NFData #endif+#endif ) instance Foldable (Node v) where@@ -217,8 +233,13 @@ deriving (Show #if __GLASGOW_HASKELL__ >= 706 , Generic+#if __GLASGOW_HASKELL__ >= 710+ , NFData #endif+#endif )+#elif __GLASGOW_HASKELL__ >= 710+ deriving (Generic, NFData) #elif __GLASGOW_HASKELL__ >= 706 deriving (Generic) #endif@@ -871,6 +892,8 @@ (><) :: (Measured v a) => FingerTree v a -> FingerTree v a -> FingerTree v a (><) = appendTree0 +-- appendTree<0..4> and addDigits<0..4> were generated by misc/mkappend.hs+ appendTree0 :: (Measured v a) => FingerTree v a -> FingerTree v a -> FingerTree v a appendTree0 Empty xs = xs@@ -1126,6 +1149,9 @@ deriving (Eq, Ord, Show #if __GLASGOW_HASKELL__ >= 706 , Generic+#if __GLASGOW_HASKELL__ >= 710+ , NFData+#endif #endif )
Data/IntervalMap/FingerTree.hs view
@@ -9,6 +9,9 @@ #if __GLASGOW_HASKELL__ >= 710 && __GLASGOW_HASKELL__ < 802 {-# LANGUAGE AutoDeriveTypeable #-} #endif+#if __GLASGOW_HASKELL__ >= 710+{-# LANGUAGE DeriveAnyClass #-}+#endif ----------------------------------------------------------------------------- -- | -- Module : Data.PriorityQueue.FingerTree@@ -65,6 +68,7 @@ #if (MIN_VERSION_base(4,9,0)) && !(MIN_VERSION_base(4,11,0)) import Data.Semigroup #endif+import Control.DeepSeq import Data.Foldable (toList) ----------------------------------@@ -77,7 +81,10 @@ deriving (Eq, Ord, Show, Read #if __GLASGOW_HASKELL__ >= 706 , Generic+#if __GLASGOW_HASKELL__ >= 710+ , NFData #endif+#endif ) -- | Lower bound of the interval@@ -96,7 +103,10 @@ deriving (Eq, Ord, Show, Read #if __GLASGOW_HASKELL__ >= 706 , Generic+#if __GLASGOW_HASKELL__ >= 710+ , NFData #endif+#endif ) instance Functor (Node v) where@@ -110,7 +120,9 @@ -- rightmost interval (including largest lower bound) and largest upper bound. data IntInterval v = NoInterval | IntInterval (Interval v) v-#if __GLASGOW_HASKELL__ >= 706+#if __GLASGOW_HASKELL__ >= 710+ deriving (Generic, NFData)+#elif __GLASGOW_HASKELL__ >= 706 deriving (Generic) #endif @@ -137,7 +149,9 @@ -- | Map of closed intervals, possibly with duplicates. newtype IntervalMap v a = IntervalMap (FingerTree (IntInterval v) (Node v a))-#if __GLASGOW_HASKELL__ >= 706+#if __GLASGOW_HASKELL__ >= 710+ deriving (Generic, NFData)+#elif __GLASGOW_HASKELL__ >= 706 deriving (Generic) #endif -- ordered lexicographically by interval
Data/PriorityQueue/FingerTree.hs view
@@ -9,6 +9,9 @@ #if __GLASGOW_HASKELL__ >= 710 && __GLASGOW_HASKELL__ < 802 {-# LANGUAGE AutoDeriveTypeable #-} #endif+#if __GLASGOW_HASKELL__ >= 710+{-# LANGUAGE DeriveAnyClass #-}+#endif ----------------------------------------------------------------------------- -- | -- Module : Data.PriorityQueue.FingerTree@@ -74,10 +77,13 @@ import Data.Semigroup #endif import Control.Arrow ((***))+import Control.DeepSeq import Data.List (unfoldr) data Entry k v = Entry k v-#if __GLASGOW_HASKELL__ >= 706+#if __GLASGOW_HASKELL__ >= 710+ deriving (Generic, NFData)+#elif __GLASGOW_HASKELL__ >= 706 deriving (Generic) #endif @@ -88,7 +94,9 @@ foldMap f (Entry _ v) = f v data Prio k v = NoPrio | Prio k v-#if __GLASGOW_HASKELL__ >= 706+#if __GLASGOW_HASKELL__ >= 710+ deriving (Generic, NFData)+#elif __GLASGOW_HASKELL__ >= 706 deriving (Generic) #endif @@ -115,7 +123,9 @@ -- | Priority queues. newtype PQueue k v = PQueue (FingerTree (Prio k v) (Entry k v))-#if __GLASGOW_HASKELL__ >= 706+#if __GLASGOW_HASKELL__ >= 710+ deriving (Generic, NFData)+#elif __GLASGOW_HASKELL__ >= 706 deriving (Generic) #endif
changelog view
@@ -1,8 +1,12 @@ -*-change-log-*- +0.1.6.0 Ross Paterson <R.Paterson@city.ac.uk> May 2025+ * Added NFData instances+ 0.1.5.0 Ross Paterson <R.Paterson@city.ac.uk> Jan 2022 * Added foldlWithPos, foldrWithPos, foldlWithContext, foldrWithContext (James Cranch) * Fixed bug in traverseWithContext+ * Made split and search stricter 0.1.4.2 Ross Paterson <R.Paterson@city.ac.uk> Dec 2018 * Fixed bug in search
fingertree.cabal view
@@ -1,5 +1,5 @@ Name: fingertree-Version: 0.1.5.0+Version: 0.1.6.0 Cabal-Version: 1.18 Copyright: (c) 2006 Ross Paterson, Ralf Hinze License: BSD3@@ -23,9 +23,8 @@ @containers@ package, which is a specialization of this structure. Build-Type: Simple-Extra-Source-Files:- changelog Extra-Doc-Files:+ changelog images/search.svg Source-Repository head@@ -33,7 +32,9 @@ Location: http://hub.darcs.net/ross/fingertree Library- Build-Depends: base < 6+ Build-Depends:+ base < 6,+ deepseq >= 1.4 && < 1.5 Default-Language: Haskell2010 Other-Extensions: MultiParamTypeClasses@@ -52,6 +53,7 @@ default-language: Haskell2010 build-depends: base >= 4.2 && < 6,+ deepseq >= 1.4 && < 1.5, HUnit, QuickCheck, test-framework,
tests/ft-properties.hs view
@@ -415,9 +415,6 @@ instance Measured [(a, b)] (a, b) where measure x = [x] -instance Measured [(a, b, c)] (a, b, c) where- measure x = [x]- ------------------------------------------------------------------------ -- A noncommutative monoid as a measure: semidirect product ------------------------------------------------------------------------