Skip to content

Commit

Permalink
Add 'insert' as synonym for '&'.
Browse files Browse the repository at this point in the history
Closes #90.
  • Loading branch information
athas committed Oct 17, 2023
1 parent 7a6a57e commit 990dfff
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -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
-------

Expand Down
5 changes: 5 additions & 0 deletions Data/Graph/Inductive/Graph.hs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ module Data.Graph.Inductive.Graph (
Graph(..),
DynGraph(..),
-- * Operations
insert,
order,
size,
-- ** Graph Folds and Maps
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 990dfff

Please sign in to comment.