{"action":"created","issue":{"url":"https://api.github.com/repos/typelift/Swiftz/issues/25","labels_url":"https://api.github.com/repos/typelift/Swiftz/issues/25/labels{/name}","comments_url":"https://api.github.com/repos/typelift/Swiftz/issues/25/comments","events_url":"https://api.github.com/repos/typelift/Swiftz/issues/25/events","html_url":"https://github.com/typelift/Swiftz/issues/25","id":35251220,"number":25,"title":"Injection / Bijection wanted?","user":{"login":"sritchie","id":69635,"avatar_url":"https://avatars.githubusercontent.com/u/69635?v=3","gravatar_id":"","url":"https://api.github.com/users/sritchie","html_url":"https://github.com/sritchie","followers_url":"https://api.github.com/users/sritchie/followers","following_url":"https://api.github.com/users/sritchie/following{/other_user}","gists_url":"https://api.github.com/users/sritchie/gists{/gist_id}","starred_url":"https://api.github.com/users/sritchie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sritchie/subscriptions","organizations_url":"https://api.github.com/users/sritchie/orgs","repos_url":"https://api.github.com/users/sritchie/repos","events_url":"https://api.github.com/users/sritchie/events{/privacy}","received_events_url":"https://api.github.com/users/sritchie/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/typelift/Swiftz/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":20,"created_at":"2014-06-08T23:54:58Z","updated_at":"2015-02-06T21:30:38Z","closed_at":"2015-02-06T21:30:38Z","body":"Hey guys,\r\n\r\nI'm the author of Twitter's [Bijection](https://github.com/twitter/bijection) library in Scala, and have found the Injection and Bijection typeclasses to be extremely useful. I'd love to get these, and a few other typeclasses, into swiftz. Here's some extremely early playing around:\r\n\r\n```swift\r\n// Playing around with the Injection typeclass.\r\nprotocol Injection {\r\n    typealias T\r\n    typealias U\r\n    func apply(T) -> U\r\n    func invert(U) -> T?\r\n}\r\n\r\nclass IntInjection: Injection {\r\n    func apply(i: Int) -> String {\r\n        return String(i)\r\n    }\r\n    func invert(s: String) -> Int? {\r\n        return s.toInt()\r\n    }\r\n}\r\n\r\nlet i = IntInjection()\r\ni.apply(10)\r\ni.invert(\"10\")\r\n```\r\n\r\nWould you guys be interested in taking this pull req? I don't want to send it over if this is beyond the library scope.\r\n\r\nOne other Q:\r\n- Would you take pull reqs for implementations of associative datastructures like those in [Algebird](https://github.com/twitter/algebird)? Or is Swiftz meant to contain typeclasses only?"},"comment":{"url":"https://api.github.com/repos/typelift/Swiftz/issues/comments/73316063","html_url":"https://github.com/typelift/Swiftz/issues/25#issuecomment-73316063","issue_url":"https://api.github.com/repos/typelift/Swiftz/issues/25","id":73316063,"user":{"login":"CodaFi","id":1896383,"avatar_url":"https://avatars.githubusercontent.com/u/1896383?v=3","gravatar_id":"","url":"https://api.github.com/users/CodaFi","html_url":"https://github.com/CodaFi","followers_url":"https://api.github.com/users/CodaFi/followers","following_url":"https://api.github.com/users/CodaFi/following{/other_user}","gists_url":"https://api.github.com/users/CodaFi/gists{/gist_id}","starred_url":"https://api.github.com/users/CodaFi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CodaFi/subscriptions","organizations_url":"https://api.github.com/users/CodaFi/orgs","repos_url":"https://api.github.com/users/CodaFi/repos","events_url":"https://api.github.com/users/CodaFi/events{/privacy}","received_events_url":"https://api.github.com/users/CodaFi/received_events","type":"User","site_admin":false},"created_at":"2015-02-06T21:30:38Z","updated_at":"2015-02-06T21:30:38Z","body":"Advancement of the Data.Lens stuff makes this issue a bit irrelevant at the moment.  Closing."}}