{"action":"created","issue":{"url":"https://api.github.com/repos/android10/Android-CleanArchitecture-Kotlin/issues/12","repository_url":"https://api.github.com/repos/android10/Android-CleanArchitecture-Kotlin","labels_url":"https://api.github.com/repos/android10/Android-CleanArchitecture-Kotlin/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/android10/Android-CleanArchitecture-Kotlin/issues/12/comments","events_url":"https://api.github.com/repos/android10/Android-CleanArchitecture-Kotlin/issues/12/events","html_url":"https://github.com/android10/Android-CleanArchitecture-Kotlin/issues/12","id":321903707,"node_id":"MDU6SXNzdWUzMjE5MDM3MDc=","number":12,"title":"Either vs Sealed class","user":{"login":"mateherber","id":13942888,"node_id":"MDQ6VXNlcjEzOTQyODg4","avatar_url":"https://avatars2.githubusercontent.com/u/13942888?v=4","gravatar_id":"","url":"https://api.github.com/users/mateherber","html_url":"https://github.com/mateherber","followers_url":"https://api.github.com/users/mateherber/followers","following_url":"https://api.github.com/users/mateherber/following{/other_user}","gists_url":"https://api.github.com/users/mateherber/gists{/gist_id}","starred_url":"https://api.github.com/users/mateherber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mateherber/subscriptions","organizations_url":"https://api.github.com/users/mateherber/orgs","repos_url":"https://api.github.com/users/mateherber/repos","events_url":"https://api.github.com/users/mateherber/events{/privacy}","received_events_url":"https://api.github.com/users/mateherber/received_events","type":"User","site_admin":false},"labels":[{"id":928070659,"node_id":"MDU6TGFiZWw5MjgwNzA2NTk=","url":"https://api.github.com/repos/android10/Android-CleanArchitecture-Kotlin/labels/discussion","name":"discussion","color":"5319e7","default":false},{"id":613738945,"node_id":"MDU6TGFiZWw2MTM3Mzg5NDU=","url":"https://api.github.com/repos/android10/Android-CleanArchitecture-Kotlin/labels/question","name":"question","color":"cc317c","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2018-05-10T11:46:31Z","updated_at":"2018-06-11T13:46:44Z","closed_at":null,"author_association":"NONE","body":"Hi @android10, long time no see :)\r\n\r\nI really enjoyed reading the new post, this seems pretty lean but also robust approach.\r\n\r\nWanted to ask about the `Either` type. I had a \"Result\" class in my mind of the following:\r\n\r\n```java\r\nsealed class Result<out T : Any>\r\n\r\nsealed class Failure(val throwable: Throwable) : Result<Nothing>()\r\n\r\ndata class Success<out T : Any>(val value: T) : Result<T>()\r\n\r\nfun test() {\r\n    val result: Result<String> = Success(\"test\")\r\n\r\n    when (result) {\r\n        is Failure -> print(result.throwable)\r\n        is Success -> print(result.value)\r\n    }\r\n}\r\n```\r\n\r\nFor me this has a nicer syntax (also could add the either extension methods with the blocks) and I don't see the benefits of the `Either` after thinking for several minutes. Of course this is up to personal taste I just wanted to ask for an opinion or check whether I missed some cool aspects between the lines :)"},"comment":{"url":"https://api.github.com/repos/android10/Android-CleanArchitecture-Kotlin/issues/comments/396248816","html_url":"https://github.com/android10/Android-CleanArchitecture-Kotlin/issues/12#issuecomment-396248816","issue_url":"https://api.github.com/repos/android10/Android-CleanArchitecture-Kotlin/issues/12","id":396248816,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NjI0ODgxNg==","user":{"login":"ariefannur","id":2806692,"node_id":"MDQ6VXNlcjI4MDY2OTI=","avatar_url":"https://avatars3.githubusercontent.com/u/2806692?v=4","gravatar_id":"","url":"https://api.github.com/users/ariefannur","html_url":"https://github.com/ariefannur","followers_url":"https://api.github.com/users/ariefannur/followers","following_url":"https://api.github.com/users/ariefannur/following{/other_user}","gists_url":"https://api.github.com/users/ariefannur/gists{/gist_id}","starred_url":"https://api.github.com/users/ariefannur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ariefannur/subscriptions","organizations_url":"https://api.github.com/users/ariefannur/orgs","repos_url":"https://api.github.com/users/ariefannur/repos","events_url":"https://api.github.com/users/ariefannur/events{/privacy}","received_events_url":"https://api.github.com/users/ariefannur/received_events","type":"User","site_admin":false},"created_at":"2018-06-11T13:46:44Z","updated_at":"2018-06-11T13:46:44Z","author_association":"NONE","body":"i have some question. about `Either class` `sealed class Either<out L, out R>`. It is same with `Pair` in kotlin ? @android10 "}}
{"actor":{"display_login":"ariefannur"}}