dom-lt 0.2.2.1 → 0.2.3
raw patch · 5 files changed
+43/−40 lines, 5 filesdep ~basedep ~containersdep ~criterionPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: base, containers, criterion
API changes (from Hackage documentation)
Files
- Changelog.md +5/−1
- Data/Graph/Dom.hs +17/−28
- Data/Graph/Dom/Internal.hs +10/−3
- dom-lt.cabal +7/−8
- tests/Main.hs +4/−0
Changelog.md view
@@ -1,6 +1,10 @@+## Changes in version 0.2.3++- Support GHC >= 7.4 by conditionally removing strictness features (the `Strict` flag and strict `IntMap`s) for GHC versions < 8.+ ## Changes in version 0.2.2.1 -Adjust codebase for ! parsing changes.+- Adjust codebase for ! parsing changes. ## Changes in version 0.2.2
Data/Graph/Dom.hs view
@@ -1,5 +1,10 @@-{-# LANGUAGE RankNTypes, BangPatterns, FlexibleContexts, Strict #-}+{-# LANGUAGE CPP #-}+{-# LANGUAGE RankNTypes, BangPatterns, FlexibleContexts #-} +#if __GLASGOW_HASKELL__ >= 800+{-# LANGUAGE Strict #-}+#endif+ {- | Module : Data.Graph.Dom Copyright : (c) Matt Morrow 2009@@ -41,18 +46,24 @@ ) where import Data.Monoid(Monoid(..))-import Data.Bifunctor import Data.Tuple (swap) import Data.Tree import Data.List import Data.IntMap(IntMap) import Data.IntSet(IntSet)-import qualified Data.IntMap.Strict as IM import qualified Data.IntSet as IS +import Control.Applicative import Control.Monad++#if MIN_VERSION_containers(0, 5, 0)+import qualified Data.IntMap.Strict as IM import Control.Monad.ST.Strict+#else+import qualified Data.IntMap as IM+import Control.Monad.ST+#endif import Data.Array.ST import Data.Array.Base@@ -601,28 +612,6 @@ a <- gets f st (a!:i) ---------------------------------------------------------------------------------- g0 = fromAdj--- [(1,[2,3])--- ,(2,[3])--- ,(3,[4])--- ,(4,[3,5,6])--- ,(5,[7])--- ,(6,[7])--- ,(7,[4,8])--- ,(8,[3,9,10])--- ,(9,[1])--- ,(10,[7])]---- g1 = fromAdj--- [(0,[1])--- ,(1,[2,3])--- ,(2,[7])--- ,(3,[4])--- ,(4,[5,6])--- ,(5,[7])--- ,(6,[4])--- ,(7,[])]-------------------------------------------------------------------------------+-- Redefine Data.Bifunctor.second for GHC 7 compatibility+second :: (b -> c) -> (a, b) -> (a, c)+second f (a, b) = (a, f b)
Data/Graph/Dom/Internal.hs view
@@ -1,10 +1,17 @@+{-# LANGUAGE CPP #-}+ module Data.Graph.Dom.Internal where import Data.Graph.Dom as D ++#if MIN_VERSION_containers(0, 5, 0)+import Data.IntMap.Strict as IM+#else+import Data.IntMap as IM+#endif import Data.Foldable as F import Data.List -import Data.IntMap.Strict as IM import Data.IntSet as IS newline :: [Char] @@ -15,8 +22,8 @@ asDotFile g = let pprNode :: (Int, IntSet) -> String pprNode (node,targets) = - concat $ intersperse newline $ fmap (pprEdge node) $ IS.toList targets + F.concat $ intersperse newline $ fmap (pprEdge node) $ IS.toList targets pprEdge v u = show v ++ " -> " ++ show u ++ ";" in "digraph G {" ++ newline ++ - (concat $ intersperse newline $ fmap pprNode (IM.toList g)) ++ newline ++ + (F.concat $ intersperse newline $ fmap pprNode (IM.toList g)) ++ newline ++ "}"
dom-lt.cabal view
@@ -1,5 +1,5 @@ name: dom-lt-version: 0.2.2.1+version: 0.2.3 cabal-version: >= 1.10 build-type: Simple license: BSD3@@ -17,9 +17,8 @@ Included are ways to compute domination and post-domination relationships. tested-with:- GHC == 8.10.1 || == 8.10.2,- GHC == 8.8.4 || == 8.8.3,- GHC == 8.0.1+ -- Every two major versions between 7 and 9 should be enough+ GHC == 9.0.1 || == 8.10.3 || == 8.8.4 || == 8.4.4 || == 8.0.2 || == 7.8.4 || == 7.4.2 Extra-Source-Files: Changelog.md@@ -37,9 +36,9 @@ ghc-options: -O2 -funbox-strict-fields default-extensions: RankNTypes build-depends:- base >= 4.9 && < 5+ base >= 4.3 && < 5 , array- , containers >= 0.5 && < 0.7+ , containers >= 0.4.2.0 && < 0.7 exposed-modules: Data.Graph.Dom, Data.Graph.Dom.Internal@@ -52,7 +51,7 @@ hs-source-dirs: tests build-depends:- base >=4.6 && <5+ base >=4.3 && <5 , dom-lt , containers , HUnit >=1.3 && <1.7@@ -67,7 +66,7 @@ Main-Is: Main.hs hs-source-dirs: benchmarks - Build-Depends: base, dom-lt, containers, criterion >= 1.4, deepseq+ Build-Depends: base, dom-lt, containers, criterion, deepseq default-extensions: Ghc-Options: -O2 -fno-full-laziness
tests/Main.hs view
@@ -1,4 +1,8 @@+{-# LANGUAGE CPP #-}++#if __GLASGOW_HASKELL__ >= 800 {-# OPTIONS_GHC -Wno-missing-signatures #-}+#endif module Main (main) where