packages feed

algebraic-graphs 0.7 → 0.8

raw patch · 54 files changed

+151/−139 lines, 54 filesdep ~basedep ~containersdep ~inspection-testingPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: base, containers, inspection-testing

API changes (from Hackage documentation)

- Algebra.Graph.Bipartite.AdjacencyMap: instance GHC.Exts.IsList (Algebra.Graph.Bipartite.AdjacencyMap.List a a)
- Algebra.Graph.Class: type family Vertex g;
- Algebra.Graph.Internal: instance GHC.Exts.IsList (Algebra.Graph.Internal.List a)
- Algebra.Graph.Label: instance GHC.Exts.IsList (Algebra.Graph.Label.Label a)
- Algebra.Graph.Label: instance GHC.Exts.IsList a => GHC.Exts.IsList (Algebra.Graph.Label.Minimum a)
- Algebra.Graph.Labelled: instance (GHC.Classes.Eq e, GHC.Base.Monoid e, GHC.Classes.Ord a, GHC.Classes.Ord e) => GHC.Classes.Ord (Algebra.Graph.Labelled.Graph e a)
- Algebra.Graph.ToGraph: type family ToVertex t;
+ Algebra.Graph.Bipartite.AdjacencyMap: instance GHC.IsList.IsList (Algebra.Graph.Bipartite.AdjacencyMap.List a a)
+ Algebra.Graph.Class: type Vertex g;
+ Algebra.Graph.Example.Todo: holiday :: Todo String
+ Algebra.Graph.Example.Todo: shopping :: Todo String
+ Algebra.Graph.Internal: instance GHC.IsList.IsList (Algebra.Graph.Internal.List a)
+ Algebra.Graph.Label: instance GHC.IsList.IsList (Algebra.Graph.Label.Label a)
+ Algebra.Graph.Label: instance GHC.IsList.IsList a => GHC.IsList.IsList (Algebra.Graph.Label.Minimum a)
+ Algebra.Graph.Label: symbol :: a -> Label a
+ Algebra.Graph.Label: symbols :: Foldable t => t a -> Label a
+ Algebra.Graph.Labelled: instance (GHC.Base.Monoid e, GHC.Classes.Ord a, GHC.Classes.Ord e) => GHC.Classes.Ord (Algebra.Graph.Labelled.Graph e a)
+ Algebra.Graph.ToGraph: type ToVertex t;
- Algebra.Graph: buildg :: (forall r. r -> (a -> r) -> (r -> r -> r) -> (r -> r -> r) -> r) -> Graph a
+ Algebra.Graph: buildg :: (forall r. () => r -> (a -> r) -> (r -> r -> r) -> (r -> r -> r) -> r) -> Graph a
- Algebra.Graph.Example.Todo: todo :: forall a. Ord a => Todo a -> Maybe [a]
+ Algebra.Graph.Example.Todo: todo :: Ord a => Todo a -> Maybe [a]
- Algebra.Graph.HigherKinded.Class: class MonadPlus g => Graph g
+ Algebra.Graph.HigherKinded.Class: class MonadPlus g => Graph (g :: Type -> Type)
- Algebra.Graph.HigherKinded.Class: class (Reflexive g, Transitive g) => Preorder g
+ Algebra.Graph.HigherKinded.Class: class (Reflexive g, Transitive g) => Preorder (g :: Type -> Type)
- Algebra.Graph.HigherKinded.Class: class Graph g => Reflexive g
+ Algebra.Graph.HigherKinded.Class: class Graph g => Reflexive (g :: Type -> Type)
- Algebra.Graph.HigherKinded.Class: class Graph g => Transitive g
+ Algebra.Graph.HigherKinded.Class: class Graph g => Transitive (g :: Type -> Type)
- Algebra.Graph.HigherKinded.Class: class Graph g => Undirected g
+ Algebra.Graph.HigherKinded.Class: class Graph g => Undirected (g :: Type -> Type)
- Algebra.Graph.Label: class (Monoid a, Semigroup a) => Semiring a
+ Algebra.Graph.Label: class Monoid a => Semiring a
- Algebra.Graph.Label: type AllShortestPaths e a = Optimum (Distance e) (PowerSet (Path a))
+ Algebra.Graph.Label: type AllShortestPaths e a = Optimum Distance e PowerSet Path a
- Algebra.Graph.Label: type CountShortestPaths e = Optimum (Distance e) (Count Integer)
+ Algebra.Graph.Label: type CountShortestPaths e = Optimum Distance e Count Integer
- Algebra.Graph.Label: type ShortestPath e a = Optimum (Distance e) (Minimum (Path a))
+ Algebra.Graph.Label: type ShortestPath e a = Optimum Distance e Minimum Path a
- Algebra.Graph.Label: type WidestPath e a = Optimum (Capacity e) (Minimum (Path a))
+ Algebra.Graph.Label: type WidestPath e a = Optimum Capacity e Minimum Path a
- Algebra.Graph.Labelled: buildg :: (forall r. r -> (a -> r) -> (e -> r -> r -> r) -> r) -> Graph e a
+ Algebra.Graph.Labelled: buildg :: (forall r. () => r -> (a -> r) -> (e -> r -> r -> r) -> r) -> Graph e a
- Algebra.Graph.Labelled: type Automaton a s = Graph (RegularExpression a) s
+ Algebra.Graph.Labelled: type Automaton a s = Graph RegularExpression a s
- Algebra.Graph.Labelled: type Network e a = Graph (Distance e) a
+ Algebra.Graph.Labelled: type Network e a = Graph Distance e a
- Algebra.Graph.ToGraph: adjacencyList :: (ToGraph t, Ord (ToVertex t)) => t -> [(ToVertex t, [ToVertex t])]
+ Algebra.Graph.ToGraph: adjacencyList :: ToGraph t => t -> [(ToVertex t, [ToVertex t])]
- Algebra.Graph.ToGraph: adjacencyMap :: ToGraph t => Ord (ToVertex t) => t -> Map (ToVertex t) (Set (ToVertex t))
+ Algebra.Graph.ToGraph: adjacencyMap :: (ToGraph t, Ord (ToVertex t)) => t -> Map (ToVertex t) (Set (ToVertex t))
- Algebra.Graph.ToGraph: dfs :: (ToGraph t, Ord (ToVertex t)) => t -> [ToVertex t] -> [ToVertex t]
+ Algebra.Graph.ToGraph: dfs :: ToGraph t => t -> [ToVertex t] -> [ToVertex t]
- Algebra.Graph.ToGraph: dfsForest :: (ToGraph t, Ord (ToVertex t)) => t -> Forest (ToVertex t)
+ Algebra.Graph.ToGraph: dfsForest :: ToGraph t => t -> Forest (ToVertex t)
- Algebra.Graph.ToGraph: dfsForestFrom :: (ToGraph t, Ord (ToVertex t)) => t -> [ToVertex t] -> Forest (ToVertex t)
+ Algebra.Graph.ToGraph: dfsForestFrom :: ToGraph t => t -> [ToVertex t] -> Forest (ToVertex t)
- Algebra.Graph.ToGraph: edgeCount :: (ToGraph t, Ord (ToVertex t)) => t -> Int
+ Algebra.Graph.ToGraph: edgeCount :: ToGraph t => t -> Int
- Algebra.Graph.ToGraph: edgeList :: (ToGraph t, Ord (ToVertex t)) => t -> [(ToVertex t, ToVertex t)]
+ Algebra.Graph.ToGraph: edgeList :: ToGraph t => t -> [(ToVertex t, ToVertex t)]
- Algebra.Graph.ToGraph: edgeSet :: (ToGraph t, Ord (ToVertex t)) => t -> Set (ToVertex t, ToVertex t)
+ Algebra.Graph.ToGraph: edgeSet :: ToGraph t => t -> Set (ToVertex t, ToVertex t)
- Algebra.Graph.ToGraph: hasEdge :: (ToGraph t, Eq (ToVertex t)) => ToVertex t -> ToVertex t -> t -> Bool
+ Algebra.Graph.ToGraph: hasEdge :: ToGraph t => ToVertex t -> ToVertex t -> t -> Bool
- Algebra.Graph.ToGraph: hasVertex :: (ToGraph t, Eq (ToVertex t)) => ToVertex t -> t -> Bool
+ Algebra.Graph.ToGraph: hasVertex :: ToGraph t => ToVertex t -> t -> Bool
- Algebra.Graph.ToGraph: isAcyclic :: (ToGraph t, Ord (ToVertex t)) => t -> Bool
+ Algebra.Graph.ToGraph: isAcyclic :: ToGraph t => t -> Bool
- Algebra.Graph.ToGraph: isDfsForestOf :: (ToGraph t, Ord (ToVertex t)) => Forest (ToVertex t) -> t -> Bool
+ Algebra.Graph.ToGraph: isDfsForestOf :: ToGraph t => Forest (ToVertex t) -> t -> Bool
- Algebra.Graph.ToGraph: isTopSortOf :: (ToGraph t, Ord (ToVertex t)) => [ToVertex t] -> t -> Bool
+ Algebra.Graph.ToGraph: isTopSortOf :: ToGraph t => [ToVertex t] -> t -> Bool
- Algebra.Graph.ToGraph: postIntSet :: (ToGraph t, ToVertex t ~ Int) => Int -> t -> IntSet
+ Algebra.Graph.ToGraph: postIntSet :: ToGraph t => Int -> t -> IntSet
- Algebra.Graph.ToGraph: postSet :: (ToGraph t, Ord (ToVertex t)) => ToVertex t -> t -> Set (ToVertex t)
+ Algebra.Graph.ToGraph: postSet :: ToGraph t => ToVertex t -> t -> Set (ToVertex t)
- Algebra.Graph.ToGraph: preIntSet :: (ToGraph t, ToVertex t ~ Int) => Int -> t -> IntSet
+ Algebra.Graph.ToGraph: preIntSet :: ToGraph t => Int -> t -> IntSet
- Algebra.Graph.ToGraph: preSet :: (ToGraph t, Ord (ToVertex t)) => ToVertex t -> t -> Set (ToVertex t)
+ Algebra.Graph.ToGraph: preSet :: ToGraph t => ToVertex t -> t -> Set (ToVertex t)
- Algebra.Graph.ToGraph: reachable :: (ToGraph t, Ord (ToVertex t)) => t -> ToVertex t -> [ToVertex t]
+ Algebra.Graph.ToGraph: reachable :: ToGraph t => t -> ToVertex t -> [ToVertex t]
- Algebra.Graph.ToGraph: toAdjacencyIntMap :: (ToGraph t, ToVertex t ~ Int) => t -> AdjacencyIntMap
+ Algebra.Graph.ToGraph: toAdjacencyIntMap :: ToGraph t => t -> AdjacencyIntMap
- Algebra.Graph.ToGraph: toAdjacencyIntMapTranspose :: (ToGraph t, ToVertex t ~ Int) => t -> AdjacencyIntMap
+ Algebra.Graph.ToGraph: toAdjacencyIntMapTranspose :: ToGraph t => t -> AdjacencyIntMap
- Algebra.Graph.ToGraph: toAdjacencyMap :: (ToGraph t, Ord (ToVertex t)) => t -> AdjacencyMap (ToVertex t)
+ Algebra.Graph.ToGraph: toAdjacencyMap :: ToGraph t => t -> AdjacencyMap (ToVertex t)
- Algebra.Graph.ToGraph: toAdjacencyMapTranspose :: (ToGraph t, Ord (ToVertex t)) => t -> AdjacencyMap (ToVertex t)
+ Algebra.Graph.ToGraph: toAdjacencyMapTranspose :: ToGraph t => t -> AdjacencyMap (ToVertex t)
- Algebra.Graph.ToGraph: topSort :: (ToGraph t, Ord (ToVertex t)) => t -> Either (Cycle (ToVertex t)) [ToVertex t]
+ Algebra.Graph.ToGraph: topSort :: ToGraph t => t -> Either (Cycle (ToVertex t)) [ToVertex t]
- Algebra.Graph.ToGraph: vertexCount :: (ToGraph t, Ord (ToVertex t)) => t -> Int
+ Algebra.Graph.ToGraph: vertexCount :: ToGraph t => t -> Int
- Algebra.Graph.ToGraph: vertexIntSet :: (ToGraph t, ToVertex t ~ Int) => t -> IntSet
+ Algebra.Graph.ToGraph: vertexIntSet :: ToGraph t => t -> IntSet
- Algebra.Graph.ToGraph: vertexList :: (ToGraph t, Ord (ToVertex t)) => t -> [ToVertex t]
+ Algebra.Graph.ToGraph: vertexList :: ToGraph t => t -> [ToVertex t]
- Algebra.Graph.ToGraph: vertexSet :: (ToGraph t, Ord (ToVertex t)) => t -> Set (ToVertex t)
+ Algebra.Graph.ToGraph: vertexSet :: ToGraph t => t -> Set (ToVertex t)

Files

CHANGES.md view
@@ -1,5 +1,10 @@ # Change log +## 0.8++* #305, #312: Support GHC 9.4, GHC 9.6 and GHC 9.8.+* #303, #314: Stop supporting GHC 8.4, GHC 8.6 and GHC 8.8.+ ## 0.7  * #294: Change the argument order of `bfs*`, `dfs*` and `reachable` algorithms.
LICENSE view
@@ -1,6 +1,6 @@ MIT License -Copyright (c) 2016-2022 Andrey Mokhov+Copyright (c) 2016-2025 Andrey Mokhov  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal
README.md view
@@ -1,6 +1,6 @@ # Algebraic graphs -[![Hackage version](https://img.shields.io/hackage/v/algebraic-graphs.svg?label=Hackage)](https://hackage.haskell.org/package/algebraic-graphs) [![Build status](https://img.shields.io/github/workflow/status/snowleopard/alga/ci/master.svg)](https://github.com/snowleopard/alga/actions)+[![Hackage version](https://img.shields.io/hackage/v/algebraic-graphs.svg?label=Hackage)](https://hackage.haskell.org/package/algebraic-graphs) [![Build status](https://img.shields.io/github/actions/workflow/status/snowleopard/alga/ci.yml?branch=master)](https://github.com/snowleopard/alga/actions)  **Alga** is a library for algebraic construction and manipulation of graphs in Haskell. See [this Haskell Symposium paper](https://github.com/snowleopard/alga-paper) and the
algebraic-graphs.cabal view
@@ -1,18 +1,18 @@ cabal-version: 2.2 name:          algebraic-graphs-version:       0.7+version:       0.8 synopsis:      A library for algebraic graph construction and transformation license:       MIT license-file:  LICENSE author:        Andrey Mokhov <andrey.mokhov@gmail.com>, github: @snowleopard maintainer:    Andrey Mokhov <andrey.mokhov@gmail.com>, github: @snowleopard,                Alexandre Moine <alexandre@moine.me>, github: @nobrakal-copyright:     Andrey Mokhov, 2016-2022+copyright:     Andrey Mokhov, 2016-2025 homepage:      https://github.com/snowleopard/alga bug-reports:   https://github.com/snowleopard/alga/issues category:      Algebra, Algorithms, Data Structures, Graphs build-type:    Simple-tested-with:   GHC==9.2, GHC==9.0, GHC==8.10, GHC==8.8, GHC==8.6, GHC==8.4+tested-with:   GHC==9.8.2, GHC==9.6.3, GHC==9.4.7, GHC==9.2.8, GHC==9.0.2, GHC==8.10.7 description:     <https://github.com/snowleopard/alga Alga> is a library for algebraic construction and     manipulation of graphs in Haskell. See <https://github.com/snowleopard/alga-paper this paper>@@ -68,10 +68,10 @@  common common-settings     build-depends:      array        >= 0.4     && < 0.6,-                        base         >= 4.11    && < 5,-                        containers   >= 0.5.5.1 && < 0.8,-                        deepseq      >= 1.3.0.1 && < 1.5,-                        transformers >= 0.4     && < 0.6+                        base         >= 4.12    && < 5,+                        containers   >= 0.5.5.1 && < 0.9,+                        deepseq      >= 1.3.0.1 && < 1.6,+                        transformers >= 0.4     && < 0.7     default-language:   Haskell2010     default-extensions: ConstraintKinds                         DeriveFunctor@@ -86,6 +86,7 @@                         TupleSections                         TypeApplications                         TypeFamilies+                        TypeOperators     other-extensions:   CPP                         OverloadedStrings                         RecordWildCards@@ -161,7 +162,7 @@                         Data.Graph.Test.Typed     build-depends:      algebraic-graphs,                         extra              >= 1.4     && < 2,-                        inspection-testing >= 0.4.2.2 && < 0.6,-                        QuickCheck         >= 2.14    && < 2.15+                        inspection-testing >= 0.4.2.2 && < 0.7,+                        QuickCheck         >= 2.14    && < 2.16     other-extensions:   ConstrainedClassMethods                         TemplateHaskell
src/Algebra/Graph.hs view
@@ -1,7 +1,7 @@ ----------------------------------------------------------------------------- -- | -- Module     : Algebra.Graph--- Copyright  : (c) Andrey Mokhov 2016-2022+-- Copyright  : (c) Andrey Mokhov 2016-2025 -- License    : MIT (see the file LICENSE) -- Maintainer : andrey.mokhov@gmail.com -- Stability  : experimental@@ -56,7 +56,7 @@ import Data.Foldable (toList) import Data.Maybe (fromMaybe) import Data.String-import Data.Tree+import Data.Tree (Tree (..)) import GHC.Generics  import Algebra.Graph.Internal
src/Algebra/Graph/Acyclic/AdjacencyMap.hs view
@@ -1,7 +1,7 @@ ----------------------------------------------------------------------------- -- | -- Module     : Algebra.Graph.Acyclic.AdjacencyMap--- Copyright  : (c) Andrey Mokhov 2016-2022+-- Copyright  : (c) Andrey Mokhov 2016-2025 -- License    : MIT (see the file LICENSE) -- Maintainer : andrey.mokhov@gmail.com -- Stability  : experimental
src/Algebra/Graph/AdjacencyIntMap.hs view
@@ -1,7 +1,7 @@ ----------------------------------------------------------------------------- -- | -- Module     : Algebra.Graph.AdjacencyIntMap--- Copyright  : (c) Andrey Mokhov 2016-2022+-- Copyright  : (c) Andrey Mokhov 2016-2025 -- License    : MIT (see the file LICENSE) -- Maintainer : andrey.mokhov@gmail.com -- Stability  : experimental@@ -51,7 +51,7 @@ import Data.List ((\\)) import Data.Monoid (Sum (..)) import Data.Set (Set)-import Data.Tree+import Data.Tree (Forest, Tree (..)) import GHC.Generics  import qualified Data.IntMap.Strict as IntMap
src/Algebra/Graph/AdjacencyIntMap/Algorithm.hs view
@@ -2,7 +2,7 @@ ----------------------------------------------------------------------------- -- | -- Module     : Algebra.Graph.AdjacencyIntMap.Algorithm--- Copyright  : (c) Andrey Mokhov 2016-2022+-- Copyright  : (c) Andrey Mokhov 2016-2025 -- License    : MIT (see the file LICENSE) -- Maintainer : andrey.mokhov@gmail.com -- Stability  : unstable
src/Algebra/Graph/AdjacencyMap.hs view
@@ -1,7 +1,7 @@ ----------------------------------------------------------------------------- -- | -- Module     : Algebra.Graph.AdjacencyMap--- Copyright  : (c) Andrey Mokhov 2016-2022+-- Copyright  : (c) Andrey Mokhov 2016-2025 -- License    : MIT (see the file LICENSE) -- Maintainer : andrey.mokhov@gmail.com -- Stability  : experimental@@ -55,7 +55,7 @@ import Data.Monoid import Data.Set (Set) import Data.String-import Data.Tree+import Data.Tree (Forest, Tree (..)) import GHC.Generics  import qualified Data.Map.Strict as Map
src/Algebra/Graph/AdjacencyMap/Algorithm.hs view
@@ -2,7 +2,7 @@ ----------------------------------------------------------------------------- -- | -- Module     : Algebra.Graph.AdjacencyMap.Algorithm--- Copyright  : (c) Andrey Mokhov 2016-2022+-- Copyright  : (c) Andrey Mokhov 2016-2025 -- License    : MIT (see the file LICENSE) -- Maintainer : andrey.mokhov@gmail.com -- Stability  : unstable@@ -33,10 +33,9 @@ import Data.Either import Data.List.NonEmpty (NonEmpty(..), (<|)) import Data.Maybe-import Data.Tree+import Data.Tree (Forest, Tree (..), flatten, levels, unfoldForestM_BF)  import Algebra.Graph.AdjacencyMap-import Algebra.Graph.Internal  import qualified Algebra.Graph.NonEmpty.AdjacencyMap as NonEmpty import qualified Data.Array                          as Array@@ -381,23 +380,25 @@     -- called when exiting vertex v. if v is the bottom of a scc     -- boundary, we add a new SCC, otherwise v is part of a larger scc     -- being constructed and we continue.-    exit v = do newComponent <- (v==).snd.head <$> gets boundaryStack-                when newComponent $ insertComponent v-                return newComponent+    exit v = do boundaryStack <- gets boundaryStack+                case boundaryStack of+                    (p_top, top) : newBoundaryStack | v == top -> do+                       insertComponent p_top top newBoundaryStack+                       return True -    insertComponent v = modify'-      (\(SCC pre scc bnd pth pres sccs gs es_i es_o) ->+                    _ -> return False++    insertComponent p_v v newBoundaryStack = modify'+      (\(SCC pre scc _oldBoundaryStack pth pres sccs gs es_i es_o) ->          let (curr,v_pth') = span (/=v) pth-             pth' = tail v_pth' -- Here we know that v_pth' starts with v+             pth' = drop 1 v_pth' -- Here we know that v_pth' starts with v              (es,es_i') = span ((>=p_v).fst) es_i              g_i | null es = vertex v                  | otherwise = edges (snd <$> es)-             p_v = fst $ head bnd              scc' = scc + 1-             bnd' = tail bnd              sccs' = List.foldl' (\sccs x -> Map.insert x scc sccs) sccs (v:curr)              gs' = g_i:gs-          in SCC pre scc' bnd' pth' pres sccs' gs' es_i' es_o)+          in SCC pre scc' newBoundaryStack pth' pres sccs' gs' es_i' es_o)      inedge uv = modify'       (\(SCC pre scc bnd pth pres sccs gs es_i es_o) ->
src/Algebra/Graph/Bipartite/AdjacencyMap.hs view
@@ -1,7 +1,7 @@ ---------------------------------------------------------------------------- -- | -- Module     : Algebra.Graph.Bipartite.AdjacencyMap--- Copyright  : (c) Andrey Mokhov 2016-2022+-- Copyright  : (c) Andrey Mokhov 2016-2025 -- License    : MIT (see the file LICENSE) -- Maintainer : andrey.mokhov@gmail.com -- Stability  : experimental@@ -53,19 +53,13 @@     consistent     ) where -import Control.Monad-import Control.Monad.Trans.Maybe-import Control.Monad.Trans.State import Data.Either-import Data.Foldable (asum) import Data.List ((\\), sort) import Data.Map.Strict (Map)-import Data.Maybe import Data.Set (Set) import GHC.Exts (IsList(..)) import GHC.Generics -import qualified Algebra.Graph              as G import qualified Algebra.Graph.AdjacencyMap as AM  import qualified Data.Map.Strict as Map
src/Algebra/Graph/Bipartite/AdjacencyMap/Algorithm.hs view
@@ -2,7 +2,7 @@ ---------------------------------------------------------------------------- -- | -- Module     : Algebra.Graph.Bipartite.AdjacencyMap.Algorithm--- Copyright  : (c) Andrey Mokhov 2016-2022+-- Copyright  : (c) Andrey Mokhov 2016-2025 -- License    : MIT (see the file LICENSE) -- Maintainer : andrey.mokhov@gmail.com -- Stability  : experimental
src/Algebra/Graph/Class.hs view
@@ -1,7 +1,7 @@ ----------------------------------------------------------------------------- -- | -- Module     : Algebra.Graph.Class--- Copyright  : (c) Andrey Mokhov 2016-2022+-- Copyright  : (c) Andrey Mokhov 2016-2025 -- License    : MIT (see the file LICENSE) -- Maintainer : andrey.mokhov@gmail.com -- Stability  : experimental@@ -46,7 +46,7 @@     path, circuit, clique, biclique, star, tree, forest     ) where -import Data.Tree+import Data.Tree (Forest, Tree (..))  import Algebra.Graph.Label (Dioid, one) 
src/Algebra/Graph/Example/Todo.hs view
@@ -1,6 +1,14 @@ {-# LANGUAGE OverloadedStrings #-}-module Algebra.Graph.Example.Todo (Todo, todo, low, high, (~*~), (>*<), priority) where+module Algebra.Graph.Example.Todo (+    -- * Creating and manipulating to-do lists+    Todo, todo, low, high, (~*~), (>*<), priority, +    -- * Examples+    shopping, holiday+    ) where++-- Based on https://blogs.ncl.ac.uk/andreymokhov/graphs-in-disguise/+ import Data.Map (Map) import Data.String @@ -13,10 +21,10 @@ data Todo a = T (Map a Int) (AdjacencyMap a) deriving Show  instance Ord a => Eq (Todo a) where-  x == y = todo x == todo y+    x == y = todo x == todo y  instance (IsString a, Ord a) => IsString (Todo a) where-  fromString = C.vertex . fromString+    fromString = C.vertex . fromString  -- Lower the priority of items in a given todo list low :: Todo a -> Todo a@@ -39,8 +47,7 @@ x >*< y = high x `C.connect` low y  todo :: forall a. Ord a => Todo a -> Maybe [a]-todo (T p g) =-  case AM.topSort $ gmap prioritise g of+todo (T p g) = case AM.topSort $ gmap prioritise g of     Left _ -> Nothing     Right xs -> Just $ map snd xs   where@@ -48,16 +55,26 @@     prioritise x = (negate $ Map.findWithDefault 0 x p, x)  instance (IsString a, Ord a) => Num (Todo a) where-  fromInteger i = fromString $ show (fromInteger i :: Integer)-  (+)           = C.overlay-  (*)           = C.connect-  signum        = const C.empty-  abs           = id-  negate        = id+    fromInteger i = fromString $ show (fromInteger i :: Integer)+    (+)           = C.overlay+    (*)           = C.connect+    signum        = const C.empty+    abs           = id+    negate        = id  instance Ord a => Graph (Todo a) where-  type Vertex (Todo a) = a-  empty    = T Map.empty AM.empty-  vertex x = T (Map.singleton x 0) (C.vertex x)-  overlay (T p1 g1) (T p2 g2) = T (Map.unionWith (+) p1 p2) (C.overlay g1 g2)-  connect (T p1 g1) (T p2 g2) = T (Map.unionWith (+) p1 p2) (C.connect g1 g2)+    type Vertex (Todo a) = a+    empty    = T Map.empty AM.empty+    vertex x = T (Map.singleton x 0) (C.vertex x)+    overlay (T p1 g1) (T p2 g2) = T (Map.unionWith (+) p1 p2) (C.overlay g1 g2)+    connect (T p1 g1) (T p2 g2) = T (Map.unionWith (+) p1 p2) (C.connect g1 g2)++-- λ> todo shopping+-- Just ["coat","presents","phone wife","scarf"]+shopping :: Todo String+shopping = "presents" + "coat" + "phone wife" ~*~ "scarf"++-- λ> todo holiday+-- Just ["coat","presents","phone wife","scarf","pack","travel"]+holiday :: Todo String+holiday = shopping * "pack" * "travel"
src/Algebra/Graph/Export.hs view
@@ -2,7 +2,7 @@ ----------------------------------------------------------------------------- -- | -- Module     : Algebra.Graph.Export--- Copyright  : (c) Andrey Mokhov 2016-2022+-- Copyright  : (c) Andrey Mokhov 2016-2025 -- License    : MIT (see the file LICENSE) -- Maintainer : andrey.mokhov@gmail.com -- Stability  : experimental@@ -37,7 +37,7 @@ -- implementation uses difference lists). Here @s@ is the type of abstract -- symbols or strings (text or binary). 'Doc' @s@ is a 'Monoid', therefore -- 'mempty' corresponds to the /empty document/ and two documents can be--- concatenated with 'mappend' (or operator 'Data.Monoid.<>'). Documents+-- concatenated with 'mappend' (or operator 'Data.Semigroup.<>'). Documents -- comprising a single symbol or string can be constructed using the function -- 'literal'. Alternatively, you can construct documents as string literals, -- e.g. simply as @"alga"@, by using the @OverloadedStrings@ GHC extension. To@@ -91,7 +91,7 @@ -- constructed directly from string literals (see the second example below). -- -- @--- literal "Hello, " 'Data.Monoid.<>' literal "World!" == literal "Hello, World!"+-- literal "Hello, " 'Data.Semigroup.<>' literal "World!" == literal "Hello, World!" -- literal "I am just a string literal"  == "I am just a string literal" -- 'render' . literal                      == 'id' -- @@@ -101,8 +101,8 @@ -- | Render the document as a single string. An inverse of the function 'literal'. -- -- @--- render ('literal' "al" 'Data.Monoid.<>' 'literal' "ga") :: ('IsString' s, 'Monoid' s) => s--- render ('literal' "al" 'Data.Monoid.<>' 'literal' "ga") == "alga"+-- render ('literal' "al" 'Data.Semigroup.<>' 'literal' "ga") :: ('IsString' s, 'Monoid' s) => s+-- render ('literal' "al" 'Data.Semigroup.<>' 'literal' "ga") == "alga" -- render 'mempty'                         == 'mempty' -- render . 'literal'                      == 'id' -- @
src/Algebra/Graph/Export/Dot.hs view
@@ -2,7 +2,7 @@ ----------------------------------------------------------------------------- -- | -- Module     : Algebra.Graph.Export.Dot--- Copyright  : (c) Andrey Mokhov 2016-2022+-- Copyright  : (c) Andrey Mokhov 2016-2025 -- License    : MIT (see the file LICENSE) -- Maintainer : andrey.mokhov@gmail.com -- Stability  : experimental@@ -21,7 +21,7 @@     export, exportAsIs, exportViaShow     ) where -import Data.List (map, null, intersperse)+import Data.List (intersperse) import Data.Monoid import Data.String hiding (unlines) import Prelude hiding (unlines)
src/Algebra/Graph/HigherKinded/Class.hs view
@@ -1,7 +1,7 @@ ----------------------------------------------------------------------------- -- | -- Module     : Algebra.Graph.HigherKinded.Class--- Copyright  : (c) Andrey Mokhov 2016-2022+-- Copyright  : (c) Andrey Mokhov 2016-2025 -- License    : MIT (see the file LICENSE) -- Maintainer : andrey.mokhov@gmail.com -- Stability  : experimental@@ -54,7 +54,7 @@  import Control.Applicative (Alternative(empty, (<|>))) import Control.Monad (MonadPlus, mfilter)-import Data.Tree+import Data.Tree (Forest, Tree (..))  import qualified Algebra.Graph as G 
src/Algebra/Graph/Internal.hs view
@@ -1,7 +1,7 @@ ----------------------------------------------------------------------------- -- | -- Module     : Algebra.Graph.Internal--- Copyright  : (c) Andrey Mokhov 2016-2022+-- Copyright  : (c) Andrey Mokhov 2016-2025 -- License    : MIT (see the file LICENSE) -- Maintainer : andrey.mokhov@gmail.com -- Stability  : experimental@@ -29,13 +29,11 @@  import Data.Coerce import Data.Foldable-import Data.IntSet (IntSet) import Data.Semigroup (Endo (..)) import Data.Set (Set) -import qualified Data.IntSet as IntSet-import qualified Data.Set    as Set-import qualified GHC.Exts    as Exts+import qualified Data.Set as Set+import qualified GHC.Exts as Exts  -- | An abstract list data type with /O(1)/ time concatenation (the current -- implementation uses difference lists). Here @a@ is the type of list elements.
src/Algebra/Graph/Label.hs view
@@ -1,7 +1,7 @@ ----------------------------------------------------------------------------- -- | -- Module     : Algebra.Graph.Label--- Copyright  : (c) Andrey Mokhov 2016-2022+-- Copyright  : (c) Andrey Mokhov 2016-2025 -- License    : MIT (see the file LICENSE) -- Maintainer : andrey.mokhov@gmail.com -- Stability  : experimental@@ -22,17 +22,16 @@     NonNegative, finite, finiteWord, unsafeFinite, infinite, getFinite,     Distance, distance, getDistance, Capacity, capacity, getCapacity,     Count, count, getCount, PowerSet (..), Minimum, getMinimum, noMinimum,-    Path, Label, isZero, RegularExpression,+    Path, Label, symbol, symbols, isZero, RegularExpression,      -- * Combining edge labels     Optimum (..), ShortestPath, AllShortestPaths, CountShortestPaths, WidestPath     ) where -import Control.Applicative import Control.Monad import Data.Coerce import Data.Maybe-import Data.Monoid (Any (..), Monoid (..), Sum (..))+import Data.Monoid (Any (..), Sum (..)) import Data.Semigroup (Max (..), Min (..)) import Data.Set (Set) import GHC.Exts (IsList (..))@@ -72,7 +71,7 @@         > x <.> (y <+> z) == x <.> y <+> x <.> z         > (x <+> y) <.> z == x <.> z <+> y <.> z -}-class (Monoid a, Semigroup a) => Semiring a where+class Monoid a => Semiring a where     one   :: a     (<.>) :: a -> a -> a @@ -285,11 +284,11 @@ instance (Num a, Eq a) => Num (Extended a) where     fromInteger = Finite . fromInteger -    (+) = liftA2 (+)+    (+) = liftM2 (+)      Finite 0 * _ = Finite 0     _ * Finite 0 = Finite 0-    x * y = liftA2 (*) x y+    x * y = liftM2 (*) x y      negate = fmap negate     signum = fmap signum@@ -331,7 +330,7 @@  instance (Monoid a, Ord a) => Semiring (Minimum a) where     one   = pure mempty-    (<.>) = liftA2 mappend+    (<.>) = liftM2 mappend  instance (Monoid a, Ord a) => Dioid (Minimum a) @@ -364,8 +363,8 @@  instance (Monoid a, Ord a) => Dioid (PowerSet a) where --- | The type of /free labels/ over the underlying set of symbols @a@. This data--- type is an instance of classes 'StarSemiring' and 'Dioid'.+-- | The type of /free labels/ over the underlying set of symbols @a@. 'Label' values+-- can be manipulated via its 'Semigroup', 'Monoid' and 'StarSemiring' class instances. data Label a = Zero              | One              | Symbol a@@ -377,9 +376,17 @@ infixl 6 :+: infixl 7 :*: +-- | Wrap a value into a 'Symbol' constructor+symbol :: a -> Label a+symbol = Symbol++-- | Wrap a list of values into 'Symbol' constructors terminated by 'Zero'+symbols :: Foldable t => t a -> Label a+symbols = foldr ((<>) . Symbol) Zero+ instance IsList (Label a) where     type Item (Label a) = a-    fromList = foldr ((<>) . Symbol) Zero+    fromList = symbols     toList   = error "Label.toList cannot be given a reasonable definition"  instance Show a => Show (Label a) where
src/Algebra/Graph/Labelled.hs view
@@ -1,7 +1,7 @@ ----------------------------------------------------------------------------- -- | -- Module     : Algebra.Graph.Labelled--- Copyright  : (c) Andrey Mokhov 2016-2022+-- Copyright  : (c) Andrey Mokhov 2016-2025 -- License    : MIT (see the file LICENSE) -- Maintainer : andrey.mokhov@gmail.com -- Stability  : experimental@@ -54,10 +54,9 @@ import qualified Algebra.Graph.Labelled.AdjacencyMap as AM import qualified Algebra.Graph.ToGraph               as T -import qualified Data.IntSet as IntSet-import qualified Data.Set    as Set-import qualified Data.Map    as Map-import qualified GHC.Exts    as Exts+import qualified Data.Set as Set+import qualified Data.Map as Map+import qualified GHC.Exts as Exts  -- | Edge-labelled graphs, where the type variable @e@ stands for edge labels. -- For example, 'Graph' @Bool@ @a@ is isomorphic to unlabelled graphs defined in@@ -71,7 +70,7 @@ instance (Eq e, Monoid e, Ord a) => Eq (Graph e a) where     x == y = toAdjacencyMap x == toAdjacencyMap y -instance (Eq e, Monoid e, Ord a, Ord e) => Ord (Graph e a) where+instance (Monoid e, Ord a, Ord e) => Ord (Graph e a) where     compare x y = compare (toAdjacencyMap x) (toAdjacencyMap y)  -- | __Note:__ this does not satisfy the usual ring laws; see 'Graph'
src/Algebra/Graph/Labelled/AdjacencyMap.hs view
@@ -1,7 +1,7 @@ ----------------------------------------------------------------------------- -- | -- Module     : Algebra.Graph.Labelled.AdjacencyMap--- Copyright  : (c) Andrey Mokhov 2016-2022+-- Copyright  : (c) Andrey Mokhov 2016-2025 -- License    : MIT (see the file LICENSE) -- Maintainer : andrey.mokhov@gmail.com -- Stability  : experimental
src/Algebra/Graph/Labelled/Example/Automaton.hs view
@@ -2,7 +2,7 @@ ----------------------------------------------------------------------------- -- | -- Module     : Algebra.Graph.Labelled.Example.Automaton--- Copyright  : (c) Andrey Mokhov 2016-2022+-- Copyright  : (c) Andrey Mokhov 2016-2025 -- License    : MIT (see the file LICENSE) -- Maintainer : andrey.mokhov@gmail.com -- Stability  : experimental
src/Algebra/Graph/Labelled/Example/Network.hs view
@@ -2,7 +2,7 @@ ----------------------------------------------------------------------------- -- | -- Module     : Algebra.Graph.Labelled.Example.Network--- Copyright  : (c) Andrey Mokhov 2016-2022+-- Copyright  : (c) Andrey Mokhov 2016-2025 -- License    : MIT (see the file LICENSE) -- Maintainer : andrey.mokhov@gmail.com -- Stability  : experimental
src/Algebra/Graph/NonEmpty.hs view
@@ -1,7 +1,7 @@ ----------------------------------------------------------------------------- -- | -- Module     : Algebra.Graph.NonEmpty--- Copyright  : (c) Andrey Mokhov 2016-2022+-- Copyright  : (c) Andrey Mokhov 2016-2025 -- License    : MIT (see the file LICENSE) -- Maintainer : andrey.mokhov@gmail.com -- Stability  : experimental@@ -53,7 +53,6 @@     ) where  import Control.DeepSeq-import Control.Monad import Control.Monad.Trans.State import Data.List.NonEmpty (NonEmpty (..)) import Data.String
src/Algebra/Graph/NonEmpty/AdjacencyMap.hs view
@@ -1,7 +1,7 @@ ----------------------------------------------------------------------------- -- | -- Module     : Algebra.Graph.NonEmpty.AdjacencyMap--- Copyright  : (c) Andrey Mokhov 2016-2022+-- Copyright  : (c) Andrey Mokhov 2016-2025 -- License    : MIT (see the file LICENSE) -- Maintainer : andrey.mokhov@gmail.com -- Stability  : experimental
src/Algebra/Graph/Relation.hs view
@@ -1,7 +1,7 @@ ----------------------------------------------------------------------------- -- | -- Module     : Algebra.Graph.Relation--- Copyright  : (c) Andrey Mokhov 2016-2022+-- Copyright  : (c) Andrey Mokhov 2016-2025 -- License    : MIT (see the file LICENSE) -- Maintainer : andrey.mokhov@gmail.com -- Stability  : experimental@@ -46,15 +46,13 @@ import Data.Bifunctor import Data.Set (Set, union) import Data.String-import Data.Tree+import Data.Tree (Tree (..)) import Data.Tuple  import qualified Data.IntSet as IntSet import qualified Data.Maybe  as Maybe import qualified Data.Set    as Set import qualified Data.Tree   as Tree--import Algebra.Graph.Internal  import qualified Algebra.Graph                 as G import qualified Algebra.Graph.AdjacencyIntMap as AIM
src/Algebra/Graph/Relation/Preorder.hs view
@@ -1,7 +1,7 @@ ----------------------------------------------------------------------------- -- | -- Module     : Algebra.Graph.Relation.Preorder--- Copyright  : (c) Andrey Mokhov 2016-2022+-- Copyright  : (c) Andrey Mokhov 2016-2025 -- License    : MIT (see the file LICENSE) -- Maintainer : andrey.mokhov@gmail.com -- Stability  : experimental
src/Algebra/Graph/Relation/Reflexive.hs view
@@ -1,7 +1,7 @@ ----------------------------------------------------------------------------- -- | -- Module     : Algebra.Graph.Relation.Reflexive--- Copyright  : (c) Andrey Mokhov 2016-2022+-- Copyright  : (c) Andrey Mokhov 2016-2025 -- License    : MIT (see the file LICENSE) -- Maintainer : andrey.mokhov@gmail.com -- Stability  : experimental
src/Algebra/Graph/Relation/Symmetric.hs view
@@ -1,7 +1,7 @@ ----------------------------------------------------------------------------- -- | -- Module     : Algebra.Graph.Relation.Symmetric--- Copyright  : (c) Andrey Mokhov 2016-2022+-- Copyright  : (c) Andrey Mokhov 2016-2025 -- License    : MIT (see the file LICENSE) -- Maintainer : andrey.mokhov@gmail.com -- Stability  : experimental@@ -45,16 +45,13 @@ import Data.Coerce import Data.Set (Set) import Data.String-import Data.Tree+import Data.Tree (Forest, Tree)  import qualified Data.IntSet as IntSet import qualified Data.Set    as Set -import qualified Algebra.Graph                 as G-import qualified Algebra.Graph.AdjacencyIntMap as AIM-import qualified Algebra.Graph.AdjacencyMap    as AM-import qualified Algebra.Graph.ToGraph         as T-import qualified Algebra.Graph.Relation        as R+import qualified Algebra.Graph.ToGraph  as T+import qualified Algebra.Graph.Relation as R  {-| This data type represents a /symmetric binary relation/ over a set of elements of type @a@. Symmetric relations satisfy all laws of the
src/Algebra/Graph/Relation/Transitive.hs view
@@ -1,7 +1,7 @@ ----------------------------------------------------------------------------- -- | -- Module     : Algebra.Graph.Relation.Transitive--- Copyright  : (c) Andrey Mokhov 2016-2022+-- Copyright  : (c) Andrey Mokhov 2016-2025 -- License    : MIT (see the file LICENSE) -- Maintainer : andrey.mokhov@gmail.com -- Stability  : experimental
src/Algebra/Graph/ToGraph.hs view
@@ -2,7 +2,7 @@ ----------------------------------------------------------------------------- -- | -- Module     : Algebra.Graph.ToGraph--- Copyright  : (c) Andrey Mokhov 2016-2022+-- Copyright  : (c) Andrey Mokhov 2016-2025 -- License    : MIT (see the file LICENSE) -- Maintainer : andrey.mokhov@gmail.com -- Stability  : experimental
src/Algebra/Graph/Undirected.hs view
@@ -1,7 +1,7 @@ ----------------------------------------------------------------------------- -- | -- Module     : Algebra.Graph.Undirected--- Copyright  : (c) Andrey Mokhov 2016-2022+-- Copyright  : (c) Andrey Mokhov 2016-2025 -- License    : MIT (see the file LICENSE) -- Maintainer : andrey.mokhov@gmail.com -- Stability  : experimental
src/Data/Graph/Typed.hs view
@@ -1,7 +1,7 @@ ----------------------------------------------------------------------------- -- | -- Module     : Data.Graph.Typed--- Copyright  : (c) Anton Lorenzen, Andrey Mokhov 2016-2022+-- Copyright  : (c) Anton Lorenzen, Andrey Mokhov 2016-2025 -- License    : MIT (see the file LICENSE) -- Maintainer : anfelor@posteo.de, andrey.mokhov@gmail.com -- Stability  : unstable
test/Algebra/Graph/Test.hs view
@@ -1,7 +1,7 @@ ----------------------------------------------------------------------------- -- | -- Module     : Algebra.Graph.Test--- Copyright  : (c) Andrey Mokhov 2016-2022+-- Copyright  : (c) Andrey Mokhov 2016-2025 -- License    : MIT (see the file LICENSE) -- Maintainer : andrey.mokhov@gmail.com -- Stability  : experimental
test/Algebra/Graph/Test/API.hs view
@@ -3,7 +3,7 @@ ----------------------------------------------------------------------------- -- | -- Module     : Algebra.Graph.Test.API--- Copyright  : (c) Andrey Mokhov 2016-2022+-- Copyright  : (c) Andrey Mokhov 2016-2025 -- License    : MIT (see the file LICENSE) -- Maintainer : andrey.mokhov@gmail.com -- Stability  : experimental
test/Algebra/Graph/Test/Acyclic/AdjacencyMap.hs view
@@ -2,7 +2,7 @@ ----------------------------------------------------------------------------- -- | -- Module     : Algebra.Graph.Test.Acyclic.AdjacencyMap--- Copyright  : (c) Andrey Mokhov 2016-2022+-- Copyright  : (c) Andrey Mokhov 2016-2025 -- License    : MIT (see the file LICENSE) -- Maintainer : andrey.mokhov@gmail.com -- Stability  : experimental
test/Algebra/Graph/Test/AdjacencyIntMap.hs view
@@ -1,7 +1,7 @@ ----------------------------------------------------------------------------- -- | -- Module     : Algebra.Graph.Test.AdjacencyIntMap--- Copyright  : (c) Andrey Mokhov 2016-2022+-- Copyright  : (c) Andrey Mokhov 2016-2025 -- License    : MIT (see the file LICENSE) -- Maintainer : andrey.mokhov@gmail.com -- Stability  : experimental
test/Algebra/Graph/Test/AdjacencyMap.hs view
@@ -2,7 +2,7 @@ ----------------------------------------------------------------------------- -- | -- Module     : Algebra.Graph.Test.AdjacencyMap--- Copyright  : (c) Andrey Mokhov 2016-2022+-- Copyright  : (c) Andrey Mokhov 2016-2025 -- License    : MIT (see the file LICENSE) -- Maintainer : andrey.mokhov@gmail.com -- Stability  : experimental
test/Algebra/Graph/Test/Arbitrary.hs view
@@ -1,9 +1,8 @@-{-# LANGUAGE CPP #-} {-# OPTIONS_GHC -fno-warn-orphans #-} ----------------------------------------------------------------------------- -- | -- Module     : Algebra.Graph.Test.Arbitrary--- Copyright  : (c) Andrey Mokhov 2016-2022+-- Copyright  : (c) Andrey Mokhov 2016-2025 -- License    : MIT (see the file LICENSE) -- Maintainer : andrey.mokhov@gmail.com -- Stability  : experimental@@ -15,10 +14,8 @@     arbitraryGraph, arbitraryRelation, arbitraryAdjacencyMap,     ) where -import Control.Monad import Data.List.NonEmpty (NonEmpty (..), toList) import Data.Maybe (catMaybes)-import Data.Tree import Test.QuickCheck  import Algebra.Graph
test/Algebra/Graph/Test/Bipartite/AdjacencyMap.hs view
@@ -2,7 +2,7 @@ ----------------------------------------------------------------------------- -- | -- Module     : Algebra.Graph.Test.Bipartite.AdjacencyMap--- Copyright  : (c) Andrey Mokhov 2016-2022+-- Copyright  : (c) Andrey Mokhov 2016-2025 -- License    : MIT (see the file LICENSE) -- Maintainer : andrey.mokhov@gmail.com -- Stability  : experimental@@ -20,7 +20,7 @@ import Algebra.Graph.Test import Data.Either import Data.Either.Extra-import Data.List (nub, sort)+import Data.List (nub) import Data.Map.Strict (Map) import Data.Set (Set) @@ -30,7 +30,6 @@ import qualified Data.Map.Strict                      as Map import qualified Data.Set                             as Set import qualified Data.Tuple-import qualified Algebra.Graph.Bipartite.AdjacencyMap as B  type AI   = AM.AdjacencyMap Int type AII  = AM.AdjacencyMap (Either Int Int)
test/Algebra/Graph/Test/Export.hs view
@@ -2,7 +2,7 @@ ----------------------------------------------------------------------------- -- | -- Module     : Algebra.Graph.Test.Export--- Copyright  : (c) Andrey Mokhov 2016-2022+-- Copyright  : (c) Andrey Mokhov 2016-2025 -- License    : MIT (see the file LICENSE) -- Maintainer : andrey.mokhov@gmail.com -- Stability  : experimental
test/Algebra/Graph/Test/Generic.hs view
@@ -2,7 +2,7 @@ ----------------------------------------------------------------------------- -- | -- Module     : Algebra.Graph.Test.Generic--- Copyright  : (c) Andrey Mokhov 2016-2022+-- Copyright  : (c) Andrey Mokhov 2016-2025 -- License    : MIT (see the file LICENSE) -- Maintainer : andrey.mokhov@gmail.com -- Stability  : experimental@@ -13,7 +13,7 @@  import Control.Monad (when) import Data.Either-import Data.List (nub, sort)+import Data.List (nub) import Data.List.NonEmpty (NonEmpty (..)) import Data.Tree import Data.Tuple
test/Algebra/Graph/Test/Graph.hs view
@@ -1,7 +1,7 @@ ----------------------------------------------------------------------------- -- | -- Module     : Algebra.Graph.Test.Graph--- Copyright  : (c) Andrey Mokhov 2016-2022+-- Copyright  : (c) Andrey Mokhov 2016-2025 -- License    : MIT (see the file LICENSE) -- Maintainer : andrey.mokhov@gmail.com -- Stability  : experimental
test/Algebra/Graph/Test/Internal.hs view
@@ -2,7 +2,7 @@ ----------------------------------------------------------------------------- -- | -- Module     : Algebra.Graph.Test.Internal--- Copyright  : (c) Andrey Mokhov 2016-2022+-- Copyright  : (c) Andrey Mokhov 2016-2025 -- License    : MIT (see the file LICENSE) -- Maintainer : andrey.mokhov@gmail.com -- Stability  : experimental
test/Algebra/Graph/Test/Label.hs view
@@ -2,7 +2,7 @@ ----------------------------------------------------------------------------- -- | -- Module     : Algebra.Graph.Test.Label--- Copyright  : (c) Andrey Mokhov 2016-2022+-- Copyright  : (c) Andrey Mokhov 2016-2025 -- License    : MIT (see the file LICENSE) -- Maintainer : andrey.mokhov@gmail.com -- Stability  : experimental
test/Algebra/Graph/Test/Labelled/AdjacencyMap.hs view
@@ -2,7 +2,7 @@ ----------------------------------------------------------------------------- -- | -- Module     : Algebra.Graph.Test.Labelled.AdjacencyMap--- Copyright  : (c) Andrey Mokhov 2016-2022+-- Copyright  : (c) Andrey Mokhov 2016-2025 -- License    : MIT (see the file LICENSE) -- Maintainer : andrey.mokhov@gmail.com -- Stability  : experimental
test/Algebra/Graph/Test/Labelled/Graph.hs view
@@ -2,7 +2,7 @@ ----------------------------------------------------------------------------- -- | -- Module     : Algebra.Graph.Test.Labelled.Graph--- Copyright  : (c) Andrey Mokhov 2016-2022+-- Copyright  : (c) Andrey Mokhov 2016-2025 -- License    : MIT (see the file LICENSE) -- Maintainer : andrey.mokhov@gmail.com -- Stability  : experimental
test/Algebra/Graph/Test/NonEmpty/AdjacencyMap.hs view
@@ -2,7 +2,7 @@ ----------------------------------------------------------------------------- -- | -- Module     : Algebra.Graph.Test.NonEmpty.AdjacencyMap--- Copyright  : (c) Andrey Mokhov 2016-2022+-- Copyright  : (c) Andrey Mokhov 2016-2025 -- License    : MIT (see the file LICENSE) -- Maintainer : andrey.mokhov@gmail.com -- Stability  : experimental
test/Algebra/Graph/Test/NonEmpty/Graph.hs view
@@ -2,7 +2,7 @@ ----------------------------------------------------------------------------- -- | -- Module     : Algebra.Graph.Test.NonEmpty.Graph--- Copyright  : (c) Andrey Mokhov 2016-2022+-- Copyright  : (c) Andrey Mokhov 2016-2025 -- License    : MIT (see the file LICENSE) -- Maintainer : andrey.mokhov@gmail.com -- Stability  : experimental
test/Algebra/Graph/Test/Relation.hs view
@@ -1,7 +1,7 @@ ----------------------------------------------------------------------------- -- | -- Module     : Algebra.Graph.Test.Relation--- Copyright  : (c) Andrey Mokhov 2016-2022+-- Copyright  : (c) Andrey Mokhov 2016-2025 -- License    : MIT (see the file LICENSE) -- Maintainer : andrey.mokhov@gmail.com -- Stability  : experimental
test/Algebra/Graph/Test/Relation/Symmetric.hs view
@@ -1,7 +1,7 @@ ----------------------------------------------------------------------------- -- | -- Module     : Algebra.Graph.Test.Relation.Symmetric--- Copyright  : (c) Andrey Mokhov 2016-2022+-- Copyright  : (c) Andrey Mokhov 2016-2025 -- License    : MIT (see the file LICENSE) -- Maintainer : andrey.mokhov@gmail.com -- Stability  : experimental
test/Algebra/Graph/Test/RewriteRules.hs view
@@ -2,7 +2,7 @@ ----------------------------------------------------------------------------- -- | -- Module     : Algebra.Graph.Test.RewriteRules--- Copyright  : (c) Andrey Mokhov 2016-2022+-- Copyright  : (c) Andrey Mokhov 2016-2025 -- License    : MIT (see the file LICENSE) -- Maintainer : andrey.mokhov@gmail.com -- Stability  : experimental
test/Algebra/Graph/Test/Undirected.hs view
@@ -1,7 +1,7 @@ ----------------------------------------------------------------------------- -- | -- Module     : Algebra.Graph.Test.Undirected--- Copyright  : (c) Andrey Mokhov 2016-2022+-- Copyright  : (c) Andrey Mokhov 2016-2025 -- License    : MIT (see the file LICENSE) -- Maintainer : andrey.mokhov@gmail.com -- Stability  : experimental
test/Data/Graph/Test/Typed.hs view
@@ -1,7 +1,7 @@ ----------------------------------------------------------------------------- -- | -- Module     : Data.Graph.Test.Typed--- Copyright  : (c) Andrey Mokhov 2016-2022+-- Copyright  : (c) Andrey Mokhov 2016-2025 -- License    : MIT (see the file LICENSE) -- Maintainer : anfelor@posteo.de, andrey.mokhov@gmail.com -- Stability  : experimental@@ -20,7 +20,7 @@ import Data.Array (array) import Data.Graph.Typed import Data.Tree-import Data.List (nub, sort)+import Data.List (nub)  import qualified Data.Graph  as KL import qualified Data.IntSet as IntSet