{"action":"opened","issue":{"url":"https://api.github.com/repos/brendanberg/L/issues/12","repository_url":"https://api.github.com/repos/brendanberg/L","labels_url":"https://api.github.com/repos/brendanberg/L/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/brendanberg/L/issues/12/comments","events_url":"https://api.github.com/repos/brendanberg/L/issues/12/events","html_url":"https://github.com/brendanberg/L/issues/12","id":321271724,"number":12,"title":"Function application chaining either breaks the stack or misapplies","user":{"login":"brendanberg","id":185650,"avatar_url":"https://avatars0.githubusercontent.com/u/185650?v=4","gravatar_id":"","url":"https://api.github.com/users/brendanberg","html_url":"https://github.com/brendanberg","followers_url":"https://api.github.com/users/brendanberg/followers","following_url":"https://api.github.com/users/brendanberg/following{/other_user}","gists_url":"https://api.github.com/users/brendanberg/gists{/gist_id}","starred_url":"https://api.github.com/users/brendanberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brendanberg/subscriptions","organizations_url":"https://api.github.com/users/brendanberg/orgs","repos_url":"https://api.github.com/users/brendanberg/repos","events_url":"https://api.github.com/users/brendanberg/events{/privacy}","received_events_url":"https://api.github.com/users/brendanberg/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-08T17:11:58Z","updated_at":"2018-05-08T17:11:58Z","closed_at":null,"author_association":"OWNER","body":"```\r\n>> Y :: (f) -> {\r\n -   (x) -> {\r\n -     f((y) -> { x(x)(y) })\r\n -   }((x) -> {\r\n -     f((y) -> { x(x)(y) })\r\n -   })\r\n - }\r\n[$Y: (f) -> {\r\n    (x) -> {\r\n        f((y) -> {\r\n            x(x)(y)\r\n        })\r\n    }((x) -> {\r\n        f((y) -> {\r\n            x(x)(y)\r\n        })\r\n    })\r\n}]\r\n>> fact :: (fn) -> {{\r\n -   (0) -> { 1 }\r\n -   (n) -> { n * fn(n - 1) }\r\n - }}\r\n[$fact: (fn) -> {\r\n    (0) -> {\r\n        1\r\n    }\r\n    (n) -> {\r\n        n * fn(n - 1)\r\n    }\r\n}]\r\n>> Y(fact)\r\n(n) -> {\r\n    n * fn(n - 1)\r\n}\r\n>> Y(fact)(5)\r\nRangeError: Maximum call stack size exceeded\r\n    at List.first (/Users/berg/Documents/projects/L/node_modules/immutable/dist/immutable.js:4782:19)\r\n    at capture (/Users/berg/Documents/projects/L/src/context.js:99:39)\r\n    at Context.match (/Users/berg/Documents/projects/L/src/context.js:231:12)\r\n    at Context.extend (/Users/berg/Documents/projects/L/src/context.js:27:22)\r\n    at Record.FunctionCall.eval (/Users/berg/Documents/projects/L/src/ast/functioncall.js:39:24)\r\n    at Record.FunctionCall.eval (/Users/berg/Documents/projects/L/src/ast/functioncall.js:31:27)\r\n    at /Users/berg/Documents/projects/L/src/ast/evaluate.js:29:40\r\n    at /Users/berg/Documents/projects/L/node_modules/immutable/dist/immutable.js:4418:31\r\n    at List.__iterate (/Users/berg/Documents/projects/L/node_modules/immutable/dist/immutable.js:2206:13)\r\n    at List.reduce (/Users/berg/Documents/projects/L/node_modules/immutable/dist/immutable.js:4413:12)\r\n```\r\n\r\n```\r\n>> curry :: (f)->(x)->(y)->{ f(x, y) }\r\n[$curry: (f) -> (x) -> (y) -> {\r\n    f(x, y)\r\n}]\r\n>> add :: (a, b) -> { a + b }\r\n[$add: (a, b) -> {\r\n    a + b\r\n}]\r\n>> add3 :: curry(add)(3)\r\n[$add3: (y) -> {\r\n    f(x, y)\r\n}]\r\n>> add3(2)\r\nTypeError: Cannot read property 'apply' of undefined\r\n    at Record.<anonymous> (/Users/berg/Documents/projects/L/src/dispatch.js:5:28)\r\n    at Record.Invocation.eval (/Users/berg/Documents/projects/L/src/ast/invocation.js:80:17)\r\n    at Record.InfixExpression.eval (/Users/berg/Documents/projects/L/src/ast/infixexpression.js:34:66)\r\n    at /Users/berg/Documents/projects/L/src/ast/evaluate.js:29:40\r\n    at /Users/berg/Documents/projects/L/node_modules/immutable/dist/immutable.js:4418:31\r\n    at List.__iterate (/Users/berg/Documents/projects/L/node_modules/immutable/dist/immutable.js:2206:13)\r\n    at List.reduce (/Users/berg/Documents/projects/L/node_modules/immutable/dist/immutable.js:4413:12)\r\n    at Record.Evaluate.eval (/Users/berg/Documents/projects/L/src/ast/evaluate.js:28:23)\r\n    at Record.FunctionCall.eval (/Users/berg/Documents/projects/L/src/ast/functioncall.js:75:42)\r\n    at /Users/berg/Documents/projects/L/src/ast/evaluate.js:29:40\r\n```"}}
{"actor":{"display_login":"brendanberg"}}