Я хочу напечатать мой точечный граф, взятый из mongoDB, а затем преобразовать в изображение.Не удалось совместить ожидаемый тип 'Control.Monad.Trans.Reader.ReaderT MongoContext IO a0' с фактическим типом 'IO()'
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