{"action":"created","issue":{"url":"https://api.github.com/repos/egonSchiele/contracts.ruby/issues/79","labels_url":"https://api.github.com/repos/egonSchiele/contracts.ruby/issues/79/labels{/name}","comments_url":"https://api.github.com/repos/egonSchiele/contracts.ruby/issues/79/comments","events_url":"https://api.github.com/repos/egonSchiele/contracts.ruby/issues/79/events","html_url":"https://github.com/egonSchiele/contracts.ruby/issues/79","id":56594848,"number":79,"title":"Tutorial: overloading == pattern matching","user":{"login":"kliuless","id":307761,"avatar_url":"https://avatars.githubusercontent.com/u/307761?v=3","gravatar_id":"","url":"https://api.github.com/users/kliuless","html_url":"https://github.com/kliuless","followers_url":"https://api.github.com/users/kliuless/followers","following_url":"https://api.github.com/users/kliuless/following{/other_user}","gists_url":"https://api.github.com/users/kliuless/gists{/gist_id}","starred_url":"https://api.github.com/users/kliuless/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kliuless/subscriptions","organizations_url":"https://api.github.com/users/kliuless/orgs","repos_url":"https://api.github.com/users/kliuless/repos","events_url":"https://api.github.com/users/kliuless/events{/privacy}","received_events_url":"https://api.github.com/users/kliuless/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-02-04T22:04:45Z","updated_at":"2015-02-05T19:52:15Z","closed_at":null,"body":"I don't know if you realize this, but your library implements [pattern matching](http://en.wikipedia.org/wiki/Pattern_matching). One thing \"missing\" is that you can't automatically pass the matched values as local variables to the method body (but I'm not even sure if this is essential to PM).\r\n\r\nExample: I can specify arbitrary nesting\r\n\r\n    Contract ({a: Num, b: [[String]]}) => String\r\n    def add h\r\n      h[:a].to_s + h[:b][0][0]\r\n    end\r\n    add(a: 2, b: [['4']])\r\n\r\nThe tutorial calls this \"overloading\", but I think it is also useful to use the name \"pattern matching\" so Googling for \"pattern matching in ruby\" would lead here :)"},"comment":{"url":"https://api.github.com/repos/egonSchiele/contracts.ruby/issues/comments/73114220","html_url":"https://github.com/egonSchiele/contracts.ruby/issues/79#issuecomment-73114220","issue_url":"https://api.github.com/repos/egonSchiele/contracts.ruby/issues/79","id":73114220,"user":{"login":"kliuless","id":307761,"avatar_url":"https://avatars.githubusercontent.com/u/307761?v=3","gravatar_id":"","url":"https://api.github.com/users/kliuless","html_url":"https://github.com/kliuless","followers_url":"https://api.github.com/users/kliuless/followers","following_url":"https://api.github.com/users/kliuless/following{/other_user}","gists_url":"https://api.github.com/users/kliuless/gists{/gist_id}","starred_url":"https://api.github.com/users/kliuless/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kliuless/subscriptions","organizations_url":"https://api.github.com/users/kliuless/orgs","repos_url":"https://api.github.com/users/kliuless/repos","events_url":"https://api.github.com/users/kliuless/events{/privacy}","received_events_url":"https://api.github.com/users/kliuless/received_events","type":"User","site_admin":false},"created_at":"2015-02-05T19:52:15Z","updated_at":"2015-02-05T19:52:15Z","body":"Do you think it was inaccurate for me to say \"rather than using conditionals\"? I really meant conditional branching statements like if/else. (I'm sort of obsessive about precision when writing docs.)"}}