fgl 5.5.2.1 → 5.5.2.2
raw patch · 7 files changed
+39/−10 lines, 7 filesdep ~containersdep ~deepseqdep ~hspecPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: containers, deepseq, hspec
API changes (from Hackage documentation)
Files
- ChangeLog +7/−0
- Data/Graph/Inductive/Graph.hs +4/−0
- Data/Graph/Inductive/Internal/Heap.hs +1/−1
- Data/Graph/Inductive/NodeMap.hs +1/−1
- Data/Graph/Inductive/PatriciaTree.hs +10/−1
- Data/Graph/Inductive/Tree.hs +1/−1
- fgl.cabal +15/−6
ChangeLog view
@@ -1,3 +1,10 @@+5.5.2.2+-------++* Ensure firing of specialised rules for `PatriciaTree`.++* Better way of only creating `NFData` instances when possible.+ 5.5.2.1 -------
Data/Graph/Inductive/Graph.hs view
@@ -186,22 +186,26 @@ -- | Map a function over the graph. gmap :: (DynGraph gr) => (Context a b -> Context c d) -> gr a b -> gr c d gmap f = ufold (\c->(f c&)) empty+{-# NOINLINE [0] gmap #-} -- | Map a function over the 'Node' labels in a graph. nmap :: (DynGraph gr) => (a -> c) -> gr a b -> gr c b nmap f = gmap (\(p,v,l,s)->(p,v,f l,s))+{-# NOINLINE [0] nmap #-} -- | Map a function over the 'Edge' labels in a graph. emap :: (DynGraph gr) => (b -> c) -> gr a b -> gr a c emap f = gmap (\(p,v,l,s)->(map1 f p,v,l,map1 f s)) where map1 g = map (first g)+{-# NOINLINE [0] emap #-} -- | Map functions over both the 'Node' and 'Edge' labels in a graph. nemap :: (DynGraph gr) => (a -> c) -> (b -> d) -> gr a b -> gr c d nemap fn fe = gmap (\(p,v,l,s) -> (fe' p,v,fn l,fe' s)) where fe' = map (first fe)+{-# NOINLINE [0] nemap #-} -- | List all 'Node's in the 'Graph'. nodes :: (Graph gr) => gr a b -> [Node]
Data/Graph/Inductive/Internal/Heap.hs view
@@ -14,7 +14,7 @@ import Text.Show (showListWith) -#if __GLASGOW_HASKELL__ >= 704+#if MIN_VERSION_containers (0,4,2) import Control.DeepSeq (NFData (..)) #endif
Data/Graph/Inductive/NodeMap.hs view
@@ -34,7 +34,7 @@ import Data.Map (Map) import qualified Data.Map as M -#if __GLASGOW_HASKELL__ >= 704+#if MIN_VERSION_containers (0,4,2) import Control.DeepSeq (NFData (..)) #endif
Data/Graph/Inductive/PatriciaTree.hs view
@@ -34,7 +34,7 @@ import Data.List (sort) import Data.Maybe (fromMaybe) -#if __GLASGOW_HASKELL__ >= 704+#if MIN_VERSION_containers (0,4,2) import Control.DeepSeq (NFData (..)) #endif @@ -184,6 +184,15 @@ where f' :: Context' a b -> Context' a c f' (ps, a, ss) = (IM.map (map f) ps, a, IM.map (map f) ss)++{-# RULES+ "nemap/Data.Graph.Inductive.PatriciaTree" nemap = fastNEMap+ #-}+fastNEMap :: forall a b c d. (a -> c) -> (b -> d) -> Gr a b -> Gr c d+fastNEMap fn fe (Gr g) = Gr (IM.map f g)+ where+ f :: Context' a b -> Context' c d+ f (ps, a, ss) = (IM.map (map fe) ps, fn a, IM.map (map fe) ss) ---------------------------------------------------------------------- -- UTILITIES
Data/Graph/Inductive/Tree.hs view
@@ -20,7 +20,7 @@ import qualified Data.Map as M import Data.Maybe (fromMaybe) -#if __GLASGOW_HASKELL__ >= 704+#if MIN_VERSION_containers (0,4,2) import Control.DeepSeq (NFData (..)) #endif
fgl.cabal view
@@ -1,5 +1,5 @@ name: fgl-version: 5.5.2.1+version: 5.5.2.2 license: BSD3 license-file: LICENSE author: Martin Erwig, Ivan Lazar Miljenovic@@ -17,10 +17,18 @@ extra-source-files: ChangeLog +tested-with: GHC == 7.4.2, GHC == 7.6.3, GHC == 7.8.4,+ GHC == 7.10.2, GHC == 7.11.*+ source-repository head type: git location: git://github.com/haskell/fgl.git +flag containers042 {+ manual: False+ default: True+}+ library { default-language: Haskell98 @@ -58,12 +66,13 @@ build-depends: base < 5 , transformers- , containers , array - if impl(ghc >= 7.4)- build-depends:- deepseq >= 1.1.0.0 && < 1.5.0.0+ if flag(containers042)+ build-depends: containers >= 0.4.2+ , deepseq >= 1.1.0.0 && < 1.5+ else+ build-depends: containers < 0.4.2 if impl(ghc >= 7.2) && impl(ghc < 7.6) build-depends:@@ -81,7 +90,7 @@ build-depends: fgl , base , QuickCheck >= 2.8 && < 2.9- , hspec == 2.1.*+ , hspec >= 2.1 && < 2.3 , containers hs-source-dirs: test