graphs 0.7.1 → 0.7.2
raw patch · 14 files changed
+52/−156 lines, 14 filesdep ~containersdep ~transformersPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: containers, transformers
API changes (from Hackage documentation)
- Data.Graph.AdjacencyList: instance GHC.Arr.Ix i => Data.Graph.Class.AdjacencyList.AdjacencyListGraph (Data.Graph.AdjacencyList.AdjacencyList i)
- Data.Graph.AdjacencyMatrix: instance (Data.Array.Base.IArray arr GHC.Types.Bool, GHC.Arr.Ix i) => Data.Graph.Class.AdjacencyMatrix.AdjacencyMatrixGraph (Data.Graph.AdjacencyMatrix.AdjacencyMatrix arr i)
- Data.Graph.Algorithm: instance (Data.Graph.Class.Graph g, Data.Semigroup.Semigroup m) => Data.Semigroup.Semigroup (Data.Graph.Algorithm.GraphSearch g m)
+ Data.Graph.AdjacencyList: instance GHC.Ix.Ix i => Data.Graph.Class.AdjacencyList.AdjacencyListGraph (Data.Graph.AdjacencyList.AdjacencyList i)
+ Data.Graph.AdjacencyMatrix: instance (Data.Array.Base.IArray arr GHC.Types.Bool, GHC.Ix.Ix i) => Data.Graph.Class.AdjacencyMatrix.AdjacencyMatrixGraph (Data.Graph.AdjacencyMatrix.AdjacencyMatrix arr i)
+ Data.Graph.Algorithm: instance (Data.Graph.Class.Graph g, GHC.Base.Semigroup m) => GHC.Base.Semigroup (Data.Graph.Algorithm.GraphSearch g m)
Files
- .travis.yml +0/−146
- CHANGELOG.markdown +4/−0
- README.markdown +1/−1
- graphs.cabal +14/−6
- src/Data/Graph/AdjacencyList.hs +2/−0
- src/Data/Graph/AdjacencyMatrix.hs +2/−0
- src/Data/Graph/Algorithm/BreadthFirstSearch.hs +1/−1
- src/Data/Graph/Class.hs +5/−1
- src/Data/Graph/Class/AdjacencyList.hs +4/−0
- src/Data/Graph/Class/AdjacencyMatrix.hs +4/−0
- src/Data/Graph/Class/Bidirectional.hs +4/−0
- src/Data/Graph/Class/EdgeEnumerable.hs +4/−0
- src/Data/Graph/Class/VertexEnumerable.hs +4/−0
- src/Data/Graph/Dual.hs +3/−1
− .travis.yml
@@ -1,146 +0,0 @@-# This Travis job script has been generated by a script via-#-# runghc make_travis_yml_2.hs '-o' '.travis.yml' '--irc-channel=irc.freenode.org#haskell-lens' '--no-no-tests-no-bench' '--no-installed' 'cabal.project'-#-# For more information, see https://github.com/hvr/multi-ghc-travis-#-language: c-sudo: false--git:- submodules: false # whether to recursively clone submodules--notifications:- irc:- channels:- - "irc.freenode.org#haskell-lens"- skip_join: true- template:- - "\x0313graphs\x03/\x0306%{branch}\x03 \x0314%{commit}\x03 %{build_url} %{message}"--cache:- directories:- - $HOME/.cabal/packages- - $HOME/.cabal/store--before_cache:- - rm -fv $HOME/.cabal/packages/hackage.haskell.org/build-reports.log- # remove files that are regenerated by 'cabal update'- - rm -fv $HOME/.cabal/packages/hackage.haskell.org/00-index.*- - rm -fv $HOME/.cabal/packages/hackage.haskell.org/*.json- - rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.cache- - rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.tar- - rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.tar.idx-- - rm -rfv $HOME/.cabal/packages/head.hackage--matrix:- include:- - compiler: "ghc-7.0.4"- # env: TEST=--disable-tests BENCH=--disable-benchmarks- addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.0,ghc-7.0.4], sources: [hvr-ghc]}}- - compiler: "ghc-7.2.2"- # env: TEST=--disable-tests BENCH=--disable-benchmarks- addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.0,ghc-7.2.2], sources: [hvr-ghc]}}- - compiler: "ghc-7.4.2"- # env: TEST=--disable-tests BENCH=--disable-benchmarks- addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.0,ghc-7.4.2], sources: [hvr-ghc]}}- - compiler: "ghc-7.6.3"- # env: TEST=--disable-tests BENCH=--disable-benchmarks- addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.0,ghc-7.6.3], sources: [hvr-ghc]}}- - compiler: "ghc-7.8.4"- # env: TEST=--disable-tests BENCH=--disable-benchmarks- addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.0,ghc-7.8.4], sources: [hvr-ghc]}}- - compiler: "ghc-7.10.3"- # env: TEST=--disable-tests BENCH=--disable-benchmarks- addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.0,ghc-7.10.3], sources: [hvr-ghc]}}- - compiler: "ghc-8.0.2"- # env: TEST=--disable-tests BENCH=--disable-benchmarks- addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.0,ghc-8.0.2], sources: [hvr-ghc]}}- - compiler: "ghc-8.2.2"- # env: TEST=--disable-tests BENCH=--disable-benchmarks- addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.0,ghc-8.2.2], sources: [hvr-ghc]}}- - compiler: "ghc-8.4.1"- env: GHCHEAD=true- addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.4.1], sources: [hvr-ghc]}}- - compiler: "ghc-head"- env: GHCHEAD=true- addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-head], sources: [hvr-ghc]}}-- allow_failures:- - compiler: "ghc-7.0.4"- - compiler: "ghc-7.2.2"- - compiler: "ghc-8.4.1"- - compiler: "ghc-head"--before_install:- - HC=${CC}- - HCPKG=${HC/ghc/ghc-pkg}- - unset CC- - ROOTDIR=$(pwd)- - mkdir -p $HOME/.local/bin- - "PATH=/opt/ghc/bin:/opt/ghc-ppa-tools/bin:$HOME/local/bin:$PATH"- - HCNUMVER=$(( $(${HC} --numeric-version|sed -E 's/([0-9]+)\.([0-9]+)\.([0-9]+).*/\1 * 10000 + \2 * 100 + \3/') ))- - echo $HCNUMVER--install:- - cabal --version- - echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]"- - BENCH=${BENCH---enable-benchmarks}- - TEST=${TEST---enable-tests}- - HADDOCK=${HADDOCK-true}- - INSTALLED=${INSTALLED-true}- - GHCHEAD=${GHCHEAD-false}- - travis_retry cabal update -v- - "sed -i.bak 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config"- - rm -fv cabal.project cabal.project.local- # Overlay Hackage Package Index for GHC HEAD: https://github.com/hvr/head.hackage- - |- if $GHCHEAD; then- sed -i.bak 's/-- allow-newer:.*/allow-newer: *:base, *:template-haskell, *:ghc, *:Cabal/' ${HOME}/.cabal/config-- echo 'repository head.hackage' >> ${HOME}/.cabal/config- echo ' url: http://head.hackage.haskell.org/' >> ${HOME}/.cabal/config- echo ' secure: True' >> ${HOME}/.cabal/config- echo ' root-keys: 07c59cb65787dedfaef5bd5f987ceb5f7e5ebf88b904bbd4c5cbdeb2ff71b740' >> ${HOME}/.cabal/config- echo ' 2e8555dde16ebd8df076f1a8ef13b8f14c66bad8eafefd7d9e37d0ed711821fb' >> ${HOME}/.cabal/config- echo ' 8f79fd2389ab2967354407ec852cbe73f2e8635793ac446d09461ffb99527f6e' >> ${HOME}/.cabal/config- echo ' key-threshold: 3' >> ${HOME}/.cabal.config-- cabal new-update head.hackage -v- fi- - grep -Ev -- '^\s*--' ${HOME}/.cabal/config | grep -Ev '^\s*$'- - "printf 'packages: \".\"\\n' > cabal.project"- - cat cabal.project- - if [ -f "./configure.ac" ]; then- (cd "." && autoreconf -i);- fi- - rm -f cabal.project.freeze- - cabal new-build -w ${HC} ${TEST} ${BENCH} --project-file="cabal.project" --dep -j2 all- - rm -rf "."/.ghc.environment.* "."/dist- - DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)--# Here starts the actual work to be performed for the package under test;-# any command which exits with a non-zero exit code causes the build to fail.-script:- # test that source-distributions can be generated- - (cd "." && cabal sdist)- - mv "."/dist/graphs-*.tar.gz ${DISTDIR}/- - cd ${DISTDIR} || false- - find . -maxdepth 1 -name '*.tar.gz' -exec tar -xvf '{}' \;- - "printf 'packages: graphs-*/*.cabal\\n' > cabal.project"- - cat cabal.project--- # build & run tests, build benchmarks- - cabal new-build -w ${HC} ${TEST} ${BENCH} all-- # cabal check- - (cd graphs-* && cabal check)-- # haddock- - rm -rf ./dist-newstyle- - if $HADDOCK; then cabal new-haddock -w ${HC} ${TEST} ${BENCH} all; else echo "Skipping haddock generation";fi--# REGENDATA ["-o",".travis.yml","--irc-channel=irc.freenode.org#haskell-lens","--no-no-tests-no-bench","--no-installed","cabal.project"]-# EOF
CHANGELOG.markdown view
@@ -1,3 +1,7 @@+0.7.2 [2022.05.07]+------------------+* Allow building with `transformers-0.6.*`.+ 0.7.1 [2018.02.24] ------------------ * Add a `Semigroup` instance for `GraphSearch`.
README.markdown view
@@ -1,7 +1,7 @@ graphs ========== -[](https://hackage.haskell.org/package/graphs) [](http://travis-ci.org/ekmett/graphs)+[](https://hackage.haskell.org/package/graphs) [](https://github.com/ekmett/graphs/actions?query=workflow%3AHaskell-CI) This provides a "not-very-Haskelly" API for calculating traversals of graphs that may be too large to fit into memory.
graphs.cabal view
@@ -1,8 +1,8 @@ name: graphs category: Algorithms, Data Structures, Graphs-version: 0.7.1+version: 0.7.2 license: BSD3-cabal-version: >= 1.6+cabal-version: >= 1.10 license-file: LICENSE author: Edward A. Kmett maintainer: Edward A. Kmett <ekmett@gmail.com>@@ -84,9 +84,14 @@ , GHC == 7.10.3 , GHC == 8.0.2 , GHC == 8.2.2- , GHC == 8.4.1+ , GHC == 8.4.4+ , GHC == 8.6.5+ , GHC == 8.8.4+ , GHC == 8.10.7+ , GHC == 9.0.2+ , GHC == 9.2.2 -extra-source-files: .travis.yml CHANGELOG.markdown README.markdown+extra-source-files: CHANGELOG.markdown README.markdown source-repository head type: git@@ -100,9 +105,9 @@ build-depends: base >= 4 && < 5, array >= 0.3 && < 0.7,- transformers >= 0.2.2 && < 0.6,+ transformers >= 0.2.2 && < 0.7, transformers-compat >= 0.3 && < 1,- containers >= 0.3 && < 0.6,+ containers >= 0.3 && < 0.7, void >= 0.5.5.1 && < 1 if !impl(ghc >= 8.0)@@ -127,9 +132,12 @@ Data.Graph.Internal.Color ghc-options: -Wall -fno-warn-deprecations+ default-language: Haskell2010 -- hack around the buggy unused matches check for class associated types in ghc 8 rc1 if impl(ghc >= 8) ghc-options: -fno-warn-unused-matches+ if impl(ghc >= 8.6)+ ghc-options: -Wno-star-is-type hs-source-dirs: src
src/Data/Graph/AdjacencyList.hs view
@@ -40,7 +40,9 @@ AdjacencyList f <*> AdjacencyList a = AdjacencyList $ \t -> f t (a t) instance Monad (AdjacencyList i) where+#if !(MIN_VERSION_base(4,11,0)) return = AdjacencyList . const+#endif AdjacencyList f >>= k = AdjacencyList $ \t -> runAdjacencyList (k (f t)) t instance Ord i => Graph (AdjacencyList i) where
src/Data/Graph/AdjacencyMatrix.hs view
@@ -40,7 +40,9 @@ AdjacencyMatrix f <*> AdjacencyMatrix a = AdjacencyMatrix $ \t -> f t (a t) instance Monad (AdjacencyMatrix arr i) where+#if !(MIN_VERSION_base(4,11,0)) return = AdjacencyMatrix . const+#endif AdjacencyMatrix f >>= k = AdjacencyMatrix $ \t -> runAdjacencyMatrix (k (f t)) t instance Ord i => Graph (AdjacencyMatrix arr i) where
src/Data/Graph/Algorithm/BreadthFirstSearch.hs view
@@ -23,7 +23,7 @@ #if __GLASGOW_HASKELL__ < 710 import Data.Monoid #endif-import Data.Sequence+import Data.Sequence (Seq(..), ViewL(..), (|>), viewl) import Data.Graph.Algorithm import Data.Graph.Class
src/Data/Graph/Class.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE CPP, TypeFamilies, FlexibleContexts #-}+{-# LANGUAGE CPP, TypeFamilies, TypeOperators, FlexibleContexts #-} ----------------------------------------------------------------------------- -- | -- Module : Data.Graph.Class@@ -28,7 +28,9 @@ import qualified Control.Monad.Trans.RWS.Lazy as Lazy import Control.Monad.Trans.Identity import Control.Monad.Trans.Maybe+#if !(MIN_VERSION_transformers(0,6,0)) import Control.Monad.Trans.Error+#endif import Control.Monad.Trans.Reader import Control.Monad.Trans.Class import Data.Functor.Identity@@ -99,11 +101,13 @@ vertexMap = liftVertexMap edgeMap = liftEdgeMap +#if !(MIN_VERSION_transformers(0,6,0)) instance (Graph g, Error e) => Graph (ErrorT e g) where type Vertex (ErrorT e g) = Vertex g type Edge (ErrorT e g) = Edge g vertexMap = liftVertexMap edgeMap = liftEdgeMap+#endif instance (Graph g, Monoid w) => Graph (Lazy.RWST r w s g) where type Vertex (Lazy.RWST r w s g) = Vertex g
src/Data/Graph/Class/AdjacencyList.hs view
@@ -27,7 +27,9 @@ import qualified Control.Monad.Trans.RWS.Lazy as Lazy import Control.Monad.Trans.Identity import Control.Monad.Trans.Maybe+#if !(MIN_VERSION_transformers(0,6,0)) import Control.Monad.Trans.Error+#endif import Control.Monad.Trans.Reader import Data.Functor.Identity #if __GLASGOW_HASKELL__ < 710@@ -103,12 +105,14 @@ outEdges = lift . outEdges outDegree = lift . outDegree +#if !(MIN_VERSION_transformers(0,6,0)) instance (AdjacencyListGraph g, Error e) => AdjacencyListGraph (ErrorT e g) where adjacentVertices = lift . adjacentVertices source = lift . source target = lift . target outEdges = lift . outEdges outDegree = lift . outDegree+#endif instance AdjacencyListGraph g => AdjacencyListGraph (MaybeT g) where adjacentVertices = lift . adjacentVertices
src/Data/Graph/Class/AdjacencyMatrix.hs view
@@ -25,7 +25,9 @@ import Control.Monad.Trans.Reader import Control.Monad.Trans.Maybe import Control.Monad.Trans.Identity+#if !(MIN_VERSION_transformers(0,6,0)) import Control.Monad.Trans.Error+#endif import Control.Monad.Trans.Class import Data.Functor.Identity #if __GLASGOW_HASKELL__ < 710@@ -57,8 +59,10 @@ instance AdjacencyMatrixGraph g => AdjacencyMatrixGraph (MaybeT g) where edge a b = lift (edge a b) +#if !(MIN_VERSION_transformers(0,6,0)) instance (AdjacencyMatrixGraph g, Error e) => AdjacencyMatrixGraph (ErrorT e g) where edge a b = lift (edge a b)+#endif instance AdjacencyMatrixGraph g => AdjacencyMatrixGraph (IdentityT g) where edge a b = lift (edge a b)
src/Data/Graph/Class/Bidirectional.hs view
@@ -27,7 +27,9 @@ import Control.Monad.Trans.Reader import Control.Monad.Trans.Identity import Control.Monad.Trans.Maybe+#if !(MIN_VERSION_transformers(0,6,0)) import Control.Monad.Trans.Error+#endif import Data.Functor.Identity #if __GLASGOW_HASKELL__ < 710 import Data.Monoid@@ -101,11 +103,13 @@ incidentEdges = lift . incidentEdges degree = lift . degree +#if !(MIN_VERSION_transformers(0,6,0)) instance (BidirectionalGraph g, Error e) => BidirectionalGraph (ErrorT e g) where inEdges = lift . inEdges inDegree = lift . inDegree incidentEdges = lift . incidentEdges degree = lift . degree+#endif instance BidirectionalGraph Identity where inEdges _ = Identity []
src/Data/Graph/Class/EdgeEnumerable.hs view
@@ -25,7 +25,9 @@ import Control.Monad.Trans.Reader import Control.Monad.Trans.Identity import Control.Monad.Trans.Maybe+#if !(MIN_VERSION_transformers(0,6,0)) import Control.Monad.Trans.Error+#endif import Control.Monad.Trans.Class import Data.Functor.Identity #if __GLASGOW_HASKELL__ < 710@@ -61,8 +63,10 @@ instance EdgeEnumerableGraph g => EdgeEnumerableGraph (IdentityT g) where edges = lift edges +#if !(MIN_VERSION_transformers(0,6,0)) instance (EdgeEnumerableGraph g, Error e) => EdgeEnumerableGraph (ErrorT e g) where edges = lift edges+#endif instance EdgeEnumerableGraph g => EdgeEnumerableGraph (ReaderT e g) where edges = lift edges
src/Data/Graph/Class/VertexEnumerable.hs view
@@ -24,7 +24,9 @@ import qualified Control.Monad.Trans.RWS.Lazy as Lazy import Control.Monad.Trans.Identity import Control.Monad.Trans.Maybe+#if !(MIN_VERSION_transformers(0,6,0)) import Control.Monad.Trans.Error+#endif import Control.Monad.Trans.Class import Control.Monad.Trans.Reader #if __GLASGOW_HASKELL__ < 710@@ -61,8 +63,10 @@ instance VertexEnumerableGraph g => VertexEnumerableGraph (IdentityT g) where vertices = lift vertices +#if !(MIN_VERSION_transformers(0,6,0)) instance (VertexEnumerableGraph g, Error e) => VertexEnumerableGraph (ErrorT e g) where vertices = lift vertices+#endif instance VertexEnumerableGraph g => VertexEnumerableGraph (ReaderT m g) where vertices = lift vertices
src/Data/Graph/Dual.hs view
@@ -43,9 +43,11 @@ Dual f *> Dual a = Dual (f *> a) instance Monad g => Monad (Dual g) where- return = Dual . return Dual g >>= k = Dual (g >>= runDual . k)+#if !(MIN_VERSION_base(4,11,0))+ return = Dual . return Dual g >> Dual h = Dual (g >> h)+#endif instance Graph g => Graph (Dual g) where type Vertex (Dual g) = Vertex g