packages feed

fgl 5.5.0.0 → 5.5.0.1

raw patch · 5 files changed

+21/−4 lines, 5 filesPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

- Data.Graph.Inductive.PatriciaTree: instance (Eq a, Eq b) => Eq (Gr a b)
- Data.Graph.Inductive.Tree: instance (Eq a, Eq b) => Eq (Gr a b)
+ Data.Graph.Inductive.Internal.FiniteMap: instance Functor (FiniteMap a)
+ Data.Graph.Inductive.PatriciaTree: instance (Eq a, Ord b) => Eq (Gr a b)
+ Data.Graph.Inductive.Tree: instance (Eq a, Ord b) => Eq (Gr a b)

Files

ChangeLog view
@@ -1,3 +1,9 @@+5.5.0.1+-------++* Fix up Eq instances for Tree and PatriciaTree so that they work with+  multiple edges.+ 5.5.0.0 ------- 
Data/Graph/Inductive/Internal/FiniteMap.hs view
@@ -23,6 +23,9 @@     Empty | Node Int (FiniteMap a b) (a,b) (FiniteMap a b)     deriving (Eq) +instance Functor (FiniteMap a) where+  fmap _ Empty = Empty+  fmap f (Node h l (i,x) r) = Node h (fmap f l) (i, f x) (fmap f r)  ---------------------------------------------------------------------- -- UTILITIES
Data/Graph/Inductive/PatriciaTree.hs view
@@ -31,12 +31,16 @@   newtype Gr a b = Gr (GraphRep a b)-                 deriving (Eq)  type GraphRep a b = IntMap (Context' a b) type Context' a b = (IntMap [b], a, IntMap [b])  type UGr = Gr () ()++instance (Eq a, Ord b) => Eq (Gr a b) where+  (Gr g1) == (Gr g2) = fmap sortAdj g1 == fmap sortAdj g2+    where+      sortAdj (a1,n,a2) = (fmap sort a1,n,fmap sort a2)  instance (Show a, Show b) => Show (Gr a b) where   showsPrec d g = showParen (d > 10) $
Data/Graph/Inductive/Tree.hs view
@@ -9,7 +9,7 @@ import Data.Graph.Inductive.Graph import Data.Graph.Inductive.Internal.FiniteMap -import Data.List  (foldl')+import Data.List  (foldl', sort) import Data.Maybe (fromJust)  ----------------------------------------------------------------------@@ -17,7 +17,6 @@ ----------------------------------------------------------------------  data Gr a b = Gr (GraphRep a b)-              deriving (Eq)  type GraphRep a b = FiniteMap Node (Context' a b) type Context' a b = (Adj b,a,Adj b)@@ -27,6 +26,11 @@ ---------------------------------------------------------------------- -- CLASS INSTANCES ----------------------------------------------------------------------++instance (Eq a, Ord b) => Eq (Gr a b) where+  (Gr g1) == (Gr g2) = fmap sortAdj g1 == fmap sortAdj g2+    where+      sortAdj (a1,n,a2) = (sort a1,n,sort a2)  instance (Show a, Show b) => Show (Gr a b) where   showsPrec d g = showParen (d > 10) $
fgl.cabal view
@@ -1,5 +1,5 @@ name:          fgl-version:       5.5.0.0+version:       5.5.0.1 license:       BSD3 license-file:  LICENSE author:        Martin Erwig, Ivan Lazar Miljenovic