diff options
author | klebinger.andreas@gmx.at <klebinger.andreas@gmx.at> | 2018-12-07 23:22:08 -0500 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2018-12-07 23:22:30 -0500 |
commit | c5ced679a6f5421eb53acf1fd1d212088145c971 (patch) | |
tree | eddaccbfe6876956cad421f3cfc5abbc79cf9b8b /compiler/utils/Digraph.hs | |
parent | a24ab444c1b2242a47e4413de6b8e610acc56b2b (diff) | |
download | haskell-c5ced679a6f5421eb53acf1fd1d212088145c971.tar.gz |
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
Diffstat (limited to 'compiler/utils/Digraph.hs')
-rw-r--r-- | compiler/utils/Digraph.hs | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/compiler/utils/Digraph.hs b/compiler/utils/Digraph.hs index bb118a65f6..cb401be274 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) |