From 1f43e82274e095e31ca5c575cc358b91982bfc45 Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Mon, 29 Oct 2018 12:00:40 +0000 Subject: Partial tree visualization --- src/Main.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Main.hs b/src/Main.hs index 529c5b0..aabff1c 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -7,6 +7,7 @@ import Data.Graph.Inductive.Example (clr479, dag4) import Data.Text.Lazy import Data.GraphViz.Printing import Data.Graph.Inductive.Graph +import Data.Graph.Inductive.PatriciaTree type Input = Bool @@ -39,7 +40,7 @@ eval (Node Xor c1 c2) = eval c1 `xor` eval c2 eval (Node Nand c1 c2) = complement $ eval c1 .&. eval c2 eval (Node Nor c1 c2) = complement $ eval c1 .|. eval c2 -visualize :: (Graph g, Show a) => Circuit a -> g String () +visualize :: (Show a) => Circuit a -> Gr String () visualize circ = uncurry mkGraph $ graph Nothing 0 ([], []) circ where -- cgit