diff --git a/ChangeLog b/ChangeLog index 2ff7619..d89c8e3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,8 @@ NEXT * Documented that some functions are partial (issue #98). +* Add `insert` function as synonym for `&` (issue #90). + 5.8.1.1 ------- diff --git a/Data/Graph/Inductive/Graph.hs b/Data/Graph/Inductive/Graph.hs index be32163..aed721a 100644 --- a/Data/Graph/Inductive/Graph.hs +++ b/Data/Graph/Inductive/Graph.hs @@ -34,6 +34,7 @@ module Data.Graph.Inductive.Graph ( Graph(..), DynGraph(..), -- * Operations + insert, order, size, -- ** Graph Folds and Maps @@ -187,6 +188,10 @@ class (Graph gr) => DynGraph gr where -- in the graph. (&) :: Context a b -> gr a b -> gr a b +-- | A synonym for '&', to avoid conflicts with the similarly named +-- operator in "Data.Function". +insert :: DynGraph gr => Context a b -> gr a b -> gr a b +insert = (&) -- | The number of nodes in the graph. An alias for 'noNodes'. order :: (Graph gr) => gr a b -> Int