tag:blogger.com,1999:blog-34374221.post4846000098392644326..comments2024-03-03T07:35:45.002+01:00Comments on geekAbyte: Easing Into Cats, And The Case For Category Theory Inspired Abstractionsdadehttp://www.blogger.com/profile/01934137473204182228noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-34374221.post-82528715008317787512019-05-23T19:21:06.920+02:002019-05-23T19:21:06.920+02:00Still not as concise and straight to the point as:...Still not as concise and straight to the point as:<br /><br /><br />def fetchMembershipInfo(id: Int): Future[Option[MembershipInfo]] = {<br /> getUser(id)<br /> .flatTraverse(getMembershipInfo)<br />}dadehttps://www.blogger.com/profile/01934137473204182228noreply@blogger.comtag:blogger.com,1999:blog-34374221.post-79601690662169120982019-05-23T17:09:55.306+02:002019-05-23T17:09:55.306+02:00I think this makes a good show case of some of Cat...I think this makes a good show case of some of Cats functionality, however some of the standard library examples could be simplified. For example, fetchMembershipInfo in task 7 can be just:<br /><br /> def fetchMembershipInfo(id: Int): Future[Option[MembershipInfo]] = {<br /> getUser(id)<br /> .map(getMembershipInfo)<br /> .getOrElse(Future.successful(None))<br /> }Bruno Medeiroshttps://www.blogger.com/profile/03194999657958955527noreply@blogger.com