{"action":"created","issue":{"url":"https://api.github.com/repos/bloomberg/bucklescript/issues/222","repository_url":"https://api.github.com/repos/bloomberg/bucklescript","labels_url":"https://api.github.com/repos/bloomberg/bucklescript/issues/222/labels{/name}","comments_url":"https://api.github.com/repos/bloomberg/bucklescript/issues/222/comments","events_url":"https://api.github.com/repos/bloomberg/bucklescript/issues/222/events","html_url":"https://github.com/bloomberg/bucklescript/issues/222","id":146708015,"number":222,"title":"pass function to js","user":{"login":"bobzhang","id":747051,"avatar_url":"https://avatars.githubusercontent.com/u/747051?v=3","gravatar_id":"","url":"https://api.github.com/users/bobzhang","html_url":"https://github.com/bobzhang","followers_url":"https://api.github.com/users/bobzhang/followers","following_url":"https://api.github.com/users/bobzhang/following{/other_user}","gists_url":"https://api.github.com/users/bobzhang/gists{/gist_id}","starred_url":"https://api.github.com/users/bobzhang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bobzhang/subscriptions","organizations_url":"https://api.github.com/users/bobzhang/orgs","repos_url":"https://api.github.com/users/bobzhang/repos","events_url":"https://api.github.com/users/bobzhang/events{/privacy}","received_events_url":"https://api.github.com/users/bobzhang/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-04-07T18:32:58Z","updated_at":"2016-04-07T18:38:48Z","closed_at":null,"body":"\r\nwhen we pass ocaml functions to js as callback, we need wrap it correctly.\r\n\r\nfor example `Array.prototype.map` for the callback, it is necessary to do the eta-conversion to ensure the arity matches..\r\n"},"comment":{"url":"https://api.github.com/repos/bloomberg/bucklescript/issues/comments/207042654","html_url":"https://github.com/bloomberg/bucklescript/issues/222#issuecomment-207042654","issue_url":"https://api.github.com/repos/bloomberg/bucklescript/issues/222","id":207042654,"user":{"login":"bobzhang","id":747051,"avatar_url":"https://avatars.githubusercontent.com/u/747051?v=3","gravatar_id":"","url":"https://api.github.com/users/bobzhang","html_url":"https://github.com/bobzhang","followers_url":"https://api.github.com/users/bobzhang/followers","following_url":"https://api.github.com/users/bobzhang/following{/other_user}","gists_url":"https://api.github.com/users/bobzhang/gists{/gist_id}","starred_url":"https://api.github.com/users/bobzhang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bobzhang/subscriptions","organizations_url":"https://api.github.com/users/bobzhang/orgs","repos_url":"https://api.github.com/users/bobzhang/repos","events_url":"https://api.github.com/users/bobzhang/events{/privacy}","received_events_url":"https://api.github.com/users/bobzhang/received_events","type":"User","site_admin":false},"created_at":"2016-04-07T18:38:48Z","updated_at":"2016-04-07T18:38:48Z","body":"for simple value like `'a -> 'b` we can do  the wrap\r\nbut there are even more complicated cases, suppose the js function expects input of type `('a -> 'b -> 'c ) array`, wrapping this value seems unrealistic"}}