1
mongoDBから取得したドットグラフを印刷してイメージに変換します。実際のタイプ 'IO()'で 'Control.Monad.Trans.Reader.ReaderT MongoContext IO a0'と一致しませんでした
run = do
docs <- timeFilter -- function to fetch [Document] from mongoDB
let dot = onlyDot docs -- exclude extra field from the documents
let dotObject = getObjId dot -- convert into an object
-- converting dot graph to string and then string to text to pass it on to parseDotGraph function
let xDotGraph = parseDotGraph (B.pack (show dotObject)) :: G.DotGraph String
Prelude.putStrLn $ B.unpack $ renderDot $ toDot xDotGraph -- this is not working, want to print
-- addExtension (runGraphviz xDotGraph) Png "graph" -- this is not working, want to draw as an image
printDocs dot
ありがとうGurkenglas、それは動作します:) – David