[commit: ghc] master: Add haddock for Node in Digraph. [skip ci] (c5ced67)
git at git.haskell.org
git at git.haskell.org
Sat Dec 8 05:05:13 UTC 2018
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/c5ced679a6f5421eb53acf1fd1d212088145c971/ghc
>---------------------------------------------------------------
commit c5ced679a6f5421eb53acf1fd1d212088145c971
Author: klebinger.andreas at gmx.at <klebinger.andreas at gmx.at>
Date: Fri Dec 7 23:22:08 2018 -0500
Add haddock for Node in Digraph. [skip ci]
Test Plan: make
Reviewers: bgamari
Reviewed By: bgamari
Subscribers: rwbarton, carter
Differential Revision: https://phabricator.haskell.org/D5378
>---------------------------------------------------------------
c5ced679a6f5421eb53acf1fd1d212088145c971
compiler/utils/Digraph.hs | 24 ++++++++++++++++--------
1 file changed, 16 insertions(+), 8 deletions(-)
diff --git a/compiler/utils/Digraph.hs b/compiler/utils/Digraph.hs
index bb118a6..cb401be 100644
--- a/compiler/utils/Digraph.hs
+++ b/compiler/utils/Digraph.hs
@@ -87,15 +87,23 @@ data Graph node = Graph {
data Edge node = Edge node node
+{-| Representation for nodes of the Graph.
+
+ * The @payload@ is user data, just carried around in this module
+
+ * The @key@ is the node identifier.
+ Key has an Ord instance for performance reasons.
+
+ * The @[key]@ are the dependencies of the node;
+ it's ok to have extra keys in the dependencies that
+ are not the key of any Node in the graph
+-}
data Node key payload = DigraphNode {
- node_payload :: payload,
- node_key :: key,
- node_dependencies :: [key] }
- -- The payload is user data, just carried around in this module
- -- The keys are ordered
- -- The [key] are the dependencies of the node;
- -- it's ok to have extra keys in the dependencies that
- -- are not the key of any Node in the graph
+ node_payload :: payload, -- ^ User data
+ node_key :: key, -- ^ User defined node id
+ node_dependencies :: [key] -- ^ Dependencies/successors of the node
+ }
+
instance (Outputable a, Outputable b) => Outputable (Node a b) where
ppr (DigraphNode a b c) = ppr (a, b, c)
More information about the ghc-commits
mailing list