aboutsummaryrefslogtreecommitdiffstats
path: root/app/Main.hs
blob: 5450b3cf1158d8fa4f7a25a95f5bb7e2ca17cfe8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
module Main where

import qualified Data.Graph.Inductive              as G
import qualified Data.GraphViz                     as Gviz
import qualified Data.GraphViz.Attributes.Complete as Gviz
import qualified Data.Text.IO                      as T
import qualified Data.Text.Lazy                    as T
import qualified Test.QuickCheck                   as QC
import           Test.VeriFuzz

instance Gviz.Labellable Gate where
  toLabelValue gate = Gviz.StrLabel . T.pack $ show gate

main :: IO ()
--main = sample (arbitrary :: Gen (Circuit Input))
main = do
  --gr <- genRandomDAG 100 :: IO (G.Gr Gate ())
--  _ <- runGraphviz (graphToDot quickParams $ emap (const "") gr) Png "output.png",
--  T.putStrLn $ generate gr
  g <- QC.generate (QC.arbitrary :: QC.Gen SourceText)
  --render . genSourceText . addTestBench . nestUpTo 20 . generateAST $ Circuit gr

  render . genSourceText . addTestBench $ g