diff options
author | Joey Hess <joeyh@joeyh.name> | 2017-04-17 12:07:02 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2017-04-17 12:10:16 -0400 |
commit | daf79506ba6ac9fa6b795ad2a19684288b367a92 (patch) | |
tree | 5cc347e0e8b08489452ccd1472c4d6f4b4c065cc /Graphviz.hs | |
parent | 8efda806c4dbb9d0acf069a34318a34e6f2bce86 (diff) | |
download | debug-me-daf79506ba6ac9fa6b795ad2a19684288b367a92.tar.gz |
add Rejected and tag hashes by type
Need a way for the user to indicate when an Activity Entered is Rejected.
Changed hashing to include type tags, so Acticity Entered and Activity
Seen can never hash to the same hash.
Got debug-me.hs to compile after these changes, but currently it's buggy
after Activity Entered is Rejected.
Started protocol.txt documentation.
This commit was sponsored by Francois Marier on Patreon.
Diffstat (limited to 'Graphviz.hs')
-rw-r--r-- | Graphviz.hs | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/Graphviz.hs b/Graphviz.hs index 81ff71a..0809468 100644 --- a/Graphviz.hs +++ b/Graphviz.hs @@ -47,18 +47,16 @@ genGraph ls = digraph (Str "debug-me") $ do forM_ ls $ \l -> case l of ActivitySeen { activitySeen = (a, h) } -> do node (display h) - [ textLabel $ display $ seenData $ activity a - , shape Circle + [ textLabel $ display $ activity a + , shape BoxShape , xcolor Green ] chain a h ActivityEntered { activityEntered = (a, h) } -> do node (display h) - [ textLabel $ display $ enteredData $ activity a - , shape Square - , if activityEnteredAccepted l - then xcolor Green - else xcolor Red + [ textLabel $ display $ activity a + , shape Circle + , xcolor Green ] chain a h where @@ -77,3 +75,13 @@ instance Display Val where instance Display Hash where display (Hash m h) = T.pack (show m) <> display h + +instance Display Seen where + display = display . seenData + +instance Display Entered where + display = display . enteredData + +instance Display a => Display (Proto a) where + display (Proto a) = display a + display (Rejected a) = "Rejected " <> display (activity a) |