{"action":"opened","issue":{"url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/issues/2471","labels_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/issues/2471/labels{/name}","comments_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/issues/2471/comments","events_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/issues/2471/events","html_url":"https://github.com/ReactiveCocoa/ReactiveCocoa/issues/2471","id":111603075,"number":2471,"title":"Question: Enum filtering","user":{"login":"schickling","id":1567498,"avatar_url":"https://avatars.githubusercontent.com/u/1567498?v=3","gravatar_id":"","url":"https://api.github.com/users/schickling","html_url":"https://github.com/schickling","followers_url":"https://api.github.com/users/schickling/followers","following_url":"https://api.github.com/users/schickling/following{/other_user}","gists_url":"https://api.github.com/users/schickling/gists{/gist_id}","starred_url":"https://api.github.com/users/schickling/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schickling/subscriptions","organizations_url":"https://api.github.com/users/schickling/orgs","repos_url":"https://api.github.com/users/schickling/repos","events_url":"https://api.github.com/users/schickling/events{/privacy}","received_events_url":"https://api.github.com/users/schickling/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-15T12:04:06Z","updated_at":"2015-10-15T12:04:06Z","closed_at":null,"body":"Note: This is not a problem with ReactiveCocoa but rather a question on what would be the best ReactiveCocoa-ish implementation.\r\n\r\nGoal: I want generically map a enum `Signal` to a `bool`.\r\n\r\nHere is a concrete example:\r\n\r\n```swift\r\nenum Color { case Blue, Red, Green }\r\n\r\nlet signal: Signal<Color>\r\n\r\n// ...\r\n\r\nlet boolSignal = signal\r\n  .map { color in\r\n    return switch {\r\n      case Blue: return true\r\n      case Red: return false\r\n      case Green: return false\r\n    }\r\n```\r\n\r\nThe generic syntax I imagine for this would be:\r\n```swift\r\nsignal.isEnum(.Blue)\r\n```\r\n\r\nIt something like this even possible in Swift 2?\r\n\r\nPS: I know about this `if case .Blue = color` notation."}}