{"action":"opened","issue":{"url":"https://api.github.com/repos/ivan-m/graphviz/issues/14","repository_url":"https://api.github.com/repos/ivan-m/graphviz","labels_url":"https://api.github.com/repos/ivan-m/graphviz/issues/14/labels{/name}","comments_url":"https://api.github.com/repos/ivan-m/graphviz/issues/14/comments","events_url":"https://api.github.com/repos/ivan-m/graphviz/issues/14/events","html_url":"https://github.com/ivan-m/graphviz/issues/14","id":183208939,"number":14,"title":"Edges before nodes","user":{"login":"joncol","id":194062,"avatar_url":"https://avatars.githubusercontent.com/u/194062?v=3","gravatar_id":"","url":"https://api.github.com/users/joncol","html_url":"https://github.com/joncol","followers_url":"https://api.github.com/users/joncol/followers","following_url":"https://api.github.com/users/joncol/following{/other_user}","gists_url":"https://api.github.com/users/joncol/gists{/gist_id}","starred_url":"https://api.github.com/users/joncol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joncol/subscriptions","organizations_url":"https://api.github.com/users/joncol/orgs","repos_url":"https://api.github.com/users/joncol/repos","events_url":"https://api.github.com/users/joncol/events{/privacy}","received_events_url":"https://api.github.com/users/joncol/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-10-15T13:09:18Z","updated_at":"2016-10-15T13:09:18Z","closed_at":null,"body":"I ran into trouble when trying to parse graphs that has edges referring to nodes that has not yet been encountered in the dot file.\r\n\r\nThe `dot` command (when run from a shell) has no problems with this, so I was wondering if it was something that I was missing, or if it's an issue with the library?\r\n\r\nI constructed the following minimal example:\r\n```haskell\r\n{-# LANGUAGE OverloadedStrings #-}\r\n \r\nmodule Main where\r\n \r\nimport           Data.Monoid ((<>))\r\nimport qualified Data.GraphViz as G\r\nimport qualified Data.GraphViz.Types.Generalised as GG\r\nimport qualified Data.Text.Lazy as T\r\n \r\ntype DG = GG.DotGraph String\r\n \r\nc1 :: T.Text\r\nc1 = \"digraph \\\"sm0\\\" {\\n\" <>\r\n     \"A\\n\" <>\r\n     \"B\\n\" <>\r\n     \"A -> B\\n\" <>\r\n     \"}\\n\"\r\n \r\nc2 :: T.Text\r\nc2 = \"digraph \\\"sm0\\\" {\\n\" <>\r\n     \"A\\n\" <>\r\n     \"A -> B\\n\" <>\r\n     \"B\\n\" <>\r\n     \"}\\n\"\r\n \r\nmain :: IO ()\r\nmain = do\r\n  putStrLn $ show (G.parseDotGraph c1 :: DG) -- works\r\n  putStrLn $ show (G.parseDotGraph c2 :: DG) -- doesn't work\r\n \r\n-- Parsing c2 leads to:\r\n--\r\n-- *** Exception: Error when parsing Dot code:\r\n-- Unable to parse the Dot graph; usually this is because of either:\r\n--   * Wrong choice of representation: try the Generalised one\r\n--   * Wrong choice of node type; try with `DotGraph String`.\r\n \r\n-- The actual parsing error was:\r\n--         Not a valid generalised DotGraph\r\n--         Not a valid value wrapped in braces.\r\n--         Missing closing bracket:\r\n--         Not the expected character: }\r\n```"}}
{"actor":{"display_login":"joncol"}}