{"action":"created","issue":{"url":"https://api.github.com/repos/erlang/otp/issues/1012","repository_url":"https://api.github.com/repos/erlang/otp","labels_url":"https://api.github.com/repos/erlang/otp/issues/1012/labels{/name}","comments_url":"https://api.github.com/repos/erlang/otp/issues/1012/comments","events_url":"https://api.github.com/repos/erlang/otp/issues/1012/events","html_url":"https://github.com/erlang/otp/pull/1012","id":147148448,"number":1012,"title":"Implement lists:join/2","user":{"login":"jlouis","id":5663,"avatar_url":"https://avatars.githubusercontent.com/u/5663?v=3","gravatar_id":"","url":"https://api.github.com/users/jlouis","html_url":"https://github.com/jlouis","followers_url":"https://api.github.com/users/jlouis/followers","following_url":"https://api.github.com/users/jlouis/following{/other_user}","gists_url":"https://api.github.com/users/jlouis/gists{/gist_id}","starred_url":"https://api.github.com/users/jlouis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jlouis/subscriptions","organizations_url":"https://api.github.com/users/jlouis/orgs","repos_url":"https://api.github.com/users/jlouis/repos","events_url":"https://api.github.com/users/jlouis/events{/privacy}","received_events_url":"https://api.github.com/users/jlouis/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2016-04-09T18:02:05Z","updated_at":"2016-04-10T10:48:57Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/erlang/otp/pulls/1012","html_url":"https://github.com/erlang/otp/pull/1012","diff_url":"https://github.com/erlang/otp/pull/1012.diff","patch_url":"https://github.com/erlang/otp/pull/1012.patch"},"body":"Add a call which works much like string:join/2 but for arbitrary lists. Provide\r\nthe function itself, lifted from Haskells Data.List standard library, provide\r\ndocumentation and provide tests for the function.\r\n\r\n## Notes for the PR:\r\n\r\n* The addition is fairly simple, and I think it should find its way into Erlang/OTP since there are so many people who write this exact function. I've known to be getting it wrong in the past in certain projects of mine.\r\n* The name `join` is what I ended up with, giving the discussion on erlang-questions@. The reason, I believe, Haskell uses the name `intersperse` has to do with the fact that in Haskell, people tend to avoid adding the module part. So the name must be quite unique, which join isn't. For Erlang, on the other hand, we have the ability to prefix with the module, so a name reuse is logical.\r\n* Why not `string:join/2` ? Because this is really a lists-module functionality which can be used in many places apart from string-like objects.\r\n* The order of the arguments is chosen to be consistent with other `lists:F/N` calls as they are all taking the list they are operating on as the last parameter. It is also consistent with the Haskell implementation of the same call.\r\n* I ran the stdlib tests, and they all pass.\r\n* I did not check the documentation a whole lot, but I wrote it based on another function from the lists module. Hopefully I did not make a mistake here.\r\n"},"comment":{"url":"https://api.github.com/repos/erlang/otp/issues/comments/207959950","html_url":"https://github.com/erlang/otp/pull/1012#issuecomment-207959950","issue_url":"https://api.github.com/repos/erlang/otp/issues/1012","id":207959950,"user":{"login":"benoitc","id":14498,"avatar_url":"https://avatars.githubusercontent.com/u/14498?v=3","gravatar_id":"","url":"https://api.github.com/users/benoitc","html_url":"https://github.com/benoitc","followers_url":"https://api.github.com/users/benoitc/followers","following_url":"https://api.github.com/users/benoitc/following{/other_user}","gists_url":"https://api.github.com/users/benoitc/gists{/gist_id}","starred_url":"https://api.github.com/users/benoitc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benoitc/subscriptions","organizations_url":"https://api.github.com/users/benoitc/orgs","repos_url":"https://api.github.com/users/benoitc/repos","events_url":"https://api.github.com/users/benoitc/events{/privacy}","received_events_url":"https://api.github.com/users/benoitc/received_events","type":"User","site_admin":false},"created_at":"2016-04-10T10:48:57Z","updated_at":"2016-04-10T10:48:57Z","body":"well to make it clear then `lists:prepend_items(Prep, List)`. Anything but intersperse would be more clear anyway since the definition of `intersperse` is:\r\n\r\n> to put things at different places within \r\n\r\nWhich doesn't really mean `prepend each items with`"}}