{"action":"created","issue":{"url":"https://api.github.com/repos/D-Programming-Language/phobos/issues/3395","labels_url":"https://api.github.com/repos/D-Programming-Language/phobos/issues/3395/labels{/name}","comments_url":"https://api.github.com/repos/D-Programming-Language/phobos/issues/3395/comments","events_url":"https://api.github.com/repos/D-Programming-Language/phobos/issues/3395/events","html_url":"https://github.com/D-Programming-Language/phobos/pull/3395","id":86110105,"number":3395,"title":"Add new algorithm: either()","user":{"login":"nordlow","id":829407,"avatar_url":"https://avatars.githubusercontent.com/u/829407?v=3","gravatar_id":"","url":"https://api.github.com/users/nordlow","html_url":"https://github.com/nordlow","followers_url":"https://api.github.com/users/nordlow/followers","following_url":"https://api.github.com/users/nordlow/following{/other_user}","gists_url":"https://api.github.com/users/nordlow/gists{/gist_id}","starred_url":"https://api.github.com/users/nordlow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nordlow/subscriptions","organizations_url":"https://api.github.com/users/nordlow/orgs","repos_url":"https://api.github.com/users/nordlow/repos","events_url":"https://api.github.com/users/nordlow/events{/privacy}","received_events_url":"https://api.github.com/users/nordlow/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":23,"created_at":"2015-06-08T09:54:45Z","updated_at":"2015-10-29T20:15:36Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/D-Programming-Language/phobos/pulls/3395","html_url":"https://github.com/D-Programming-Language/phobos/pull/3395","diff_url":"https://github.com/D-Programming-Language/phobos/pull/3395.diff","patch_url":"https://github.com/D-Programming-Language/phobos/pull/3395.patch"},"body":"Thanks to D's lazy parameters this function simplify pattern matching:\r\n\r\n`either()` similar to Python/Lisp's `or`. Same as D's `any` but returns first parameter value which implicitly convert to true, or last argument otherwise. I guess `any` could be modified but that would cause breakage on its return type.\r\n\r\nI've found real use of `either()`in various parsing contexts.\r\n\r\nI'm very open to changing the namings if you feel they are misguiding.\r\n\r\nNote that `either` currently cannot be `nothrow` because of issue    https://issues.dlang.org/show_bug.cgi?id=12647"},"comment":{"url":"https://api.github.com/repos/D-Programming-Language/phobos/issues/comments/152305882","html_url":"https://github.com/D-Programming-Language/phobos/pull/3395#issuecomment-152305882","issue_url":"https://api.github.com/repos/D-Programming-Language/phobos/issues/3395","id":152305882,"user":{"login":"andralex","id":566679,"avatar_url":"https://avatars.githubusercontent.com/u/566679?v=3","gravatar_id":"","url":"https://api.github.com/users/andralex","html_url":"https://github.com/andralex","followers_url":"https://api.github.com/users/andralex/followers","following_url":"https://api.github.com/users/andralex/following{/other_user}","gists_url":"https://api.github.com/users/andralex/gists{/gist_id}","starred_url":"https://api.github.com/users/andralex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andralex/subscriptions","organizations_url":"https://api.github.com/users/andralex/orgs","repos_url":"https://api.github.com/users/andralex/repos","events_url":"https://api.github.com/users/andralex/events{/privacy}","received_events_url":"https://api.github.com/users/andralex/received_events","type":"User","site_admin":false},"created_at":"2015-10-29T20:15:36Z","updated_at":"2015-10-29T20:15:36Z","body":"thx!"}}