Fork me on GitHub
#funcool
<
2018-08-25
>
mping15:08:03

Hi guys, does cats have mapcat?

mping15:08:08

I’m trying to translate this code:

mping15:08:23

import scala.io.Source
def getURLContent(url: String): Try[Iterator[String]] =
  for {
    url <- parseURL(url)
    connection <- Try(url.openConnection())
    is <- Try(connection.getInputStream)
    source = Source.fromInputStream(is)
  } yield source.getLines()
taken from https://danielwestheide.com/blog/2012/12/26/the-neophytes-guide-to-scala-part-6-error-handling-with-try.html to see what it would look like