diff options
author | Daniel Burrows <dburrows@debian.org> | 2009-04-03 08:57:01 -0700 |
---|---|---|
committer | Daniel Burrows <dburrows@debian.org> | 2009-04-03 08:57:01 -0700 |
commit | 7c127543c79f3298c75bf608566ae0b1300c172b (patch) | |
tree | 486cb033f42aef7bce111c1b44debbb84033e656 /tools | |
parent | 4ef4de9b8a5678052b96e7741e7ea993a0a65e80 (diff) | |
download | aptitude-7c127543c79f3298c75bf608566ae0b1300c172b.tar.gz |
Write an extra convenience operator for adding attributes, and export all the convenience operators.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/resolver-visualize/Dot.hs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/resolver-visualize/Dot.hs b/tools/resolver-visualize/Dot.hs index d65110d6..45684b72 100644 --- a/tools/resolver-visualize/Dot.hs +++ b/tools/resolver-visualize/Dot.hs @@ -9,7 +9,8 @@ module Dot( Name(), AttrValue(), name, attrValue, node, edge, digraph, - genNodes + genNodes, + (.=), (..=), (.!) ) where @@ -61,6 +62,10 @@ class Attributed a where (.=) :: (Attributed a, AttributeValue v) => a -> (String, v) -> a a .= (nameString, v) = addAttribute a (name nameString) (Just $ valueString v) +-- EW: hack to pretend-overload .= on strings. +(..=) :: (Attributed a) => a -> (String, String) -> a +a ..= (nameString, valString) = addAttribute a (name nameString) (Just $ attrValue valString) + (.!) :: Attributed a => a -> Name -> a a .! name = addAttribute a name Nothing |