{"action":"created","issue":{"url":"https://api.github.com/repos/Dandandan/parser/issues/15","labels_url":"https://api.github.com/repos/Dandandan/parser/issues/15/labels{/name}","comments_url":"https://api.github.com/repos/Dandandan/parser/issues/15/comments","events_url":"https://api.github.com/repos/Dandandan/parser/issues/15/events","html_url":"https://github.com/Dandandan/parser/issues/15","id":95361579,"number":15,"title":"`undefined is not an object (evaluating 'p.ctor')`","user":{"login":"zeckalpha","id":969868,"avatar_url":"https://avatars.githubusercontent.com/u/969868?v=3","gravatar_id":"","url":"https://api.github.com/users/zeckalpha","html_url":"https://github.com/zeckalpha","followers_url":"https://api.github.com/users/zeckalpha/followers","following_url":"https://api.github.com/users/zeckalpha/following{/other_user}","gists_url":"https://api.github.com/users/zeckalpha/gists{/gist_id}","starred_url":"https://api.github.com/users/zeckalpha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zeckalpha/subscriptions","organizations_url":"https://api.github.com/users/zeckalpha/orgs","repos_url":"https://api.github.com/users/zeckalpha/repos","events_url":"https://api.github.com/users/zeckalpha/events{/privacy}","received_events_url":"https://api.github.com/users/zeckalpha/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2015-07-16T06:31:41Z","updated_at":"2015-07-22T18:15:28Z","closed_at":"2015-07-16T21:36:51Z","body":"Hello!\r\n\r\nThis is a handy library! I made a lisp, and am refactoring a s-expression library out of it, however, I seem to be running into issues with `Parser.recursively`. It compiles fine, but then I get the JavaScript error: `undefined is not an object (evaluating 'p.ctor')`.\r\n\r\nHere's what I have for now.\r\n\r\n~~~ haskell\r\nmodule Sexp where\r\n\r\nimport String\r\nimport List\r\nimport Graphics.Element\r\n\r\nimport Parser\r\nimport Parser exposing (Parser, (<*>), (<$>))\r\nimport Parser.Char\r\n\r\ntype Sexp\r\n  = SexpList (List Sexp)\r\n  | SexpElement String\r\n\r\nparse string =\r\n  Parser.parse parser' string\r\n\r\nparser' =\r\n  Parser.recursively (\\() -> parser)\r\n\r\nparser =\r\n  Parser.or listParser elementParser\r\n\r\nlistParser =\r\n  SexpList <$>\r\n    (Parser.Char.parenthesized\r\n      <| Parser.separatedBy parser' whitespaceParser)\r\n\r\nelementParser =\r\n  SexpElement << String.fromList <$>\r\n    (Parser.some\r\n      <| Parser.satisfy\r\n        <| \\c -> not ((isWhitespace c) || c == '(' || c == ')'))\r\n\r\nwhitespaceParser =\r\n  Parser.satisfy isWhitespace\r\n\r\nisWhitespace char =\r\n  List.member char <| String.toList \" \\t\\r\\n\\v\\f\"\r\n\r\nmain : Graphics.Element.Element\r\nmain = Graphics.Element.show\r\n  <| parse \"((test) test)\"\r\n~~~\r\n\r\nI've tried a few different combinations of wrapping the sub-parsers with recursively, and different combinations of the recursively call / not recursively everywhere. I can't seem to figure it out.\r\n"},"comment":{"url":"https://api.github.com/repos/Dandandan/parser/issues/comments/123814494","html_url":"https://github.com/Dandandan/parser/issues/15#issuecomment-123814494","issue_url":"https://api.github.com/repos/Dandandan/parser/issues/15","id":123814494,"user":{"login":"zeckalpha","id":969868,"avatar_url":"https://avatars.githubusercontent.com/u/969868?v=3","gravatar_id":"","url":"https://api.github.com/users/zeckalpha","html_url":"https://github.com/zeckalpha","followers_url":"https://api.github.com/users/zeckalpha/followers","following_url":"https://api.github.com/users/zeckalpha/following{/other_user}","gists_url":"https://api.github.com/users/zeckalpha/gists{/gist_id}","starred_url":"https://api.github.com/users/zeckalpha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zeckalpha/subscriptions","organizations_url":"https://api.github.com/users/zeckalpha/orgs","repos_url":"https://api.github.com/users/zeckalpha/repos","events_url":"https://api.github.com/users/zeckalpha/events{/privacy}","received_events_url":"https://api.github.com/users/zeckalpha/received_events","type":"User","site_admin":false},"created_at":"2015-07-22T18:15:28Z","updated_at":"2015-07-22T18:15:28Z","body":"Nope, that didn't do it."}}