Skip to Content
Mastering Functional Programming
book

Mastering Functional Programming

by Anatolii Kmetiuk
August 2018
Intermediate to advanced
380 pages
10h 2m
English
Packt Publishing
Content preview from Mastering Functional Programming

Sequential solution

First of all, let's have a look at how we would like to use the solution once it is built. Also, let's have a look at exactly which output we expect from the solution:

val target = new URL("http://mvnrepository.com/")val res = fetchToDepth(target, 1) println(res.take(10).mkString("\n")) println(res.size)

In the preceding code, we perform the following things. First of all, we would like to be able to define our URL in terms of a Java-native URL object. In this example, we are using the Maven repository website as a crawling target. mvnrepository.com is a website that provides an easy search through all of the Maven packages.

After that, we have a call to fetchToDepth. This is the method that is supposed to do the actual ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning Functional Programming

Learning Functional Programming

Jack Widman

Publisher Resources

ISBN: 9781788620796Supplemental Content