Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Mastering Functional Programming

You're reading from   Mastering Functional Programming Functional techniques for sequential and parallel programming with Scala

Arrow left icon
Product type Paperback
Published in Aug 2018
Publisher Packt
ISBN-13 9781788620796
Length 380 pages
Edition 1st Edition
Languages
Arrow right icon
Toc

Table of Contents (23) Chapters Close

Title Page
Copyright and Credits
Dedication
Packt Upsell
Contributors
Preface
1. The Declarative Programming Style 2. Functions and Lambdas FREE CHAPTER 3. Functional Data Structures 4. The Problem of Side Effects 5. Effect Types - Abstracting Away Side Effects 6. Effect Types in Practice 7. The Idea of the Type Classes 8. Basic Type Classes and Their Usage 9. Libraries for Pure Functional Programming 10. Patterns of Advanced Functional Programming 11. Introduction to the Actor Model 12. The Actor Model in Practice 13. Use Case - A Parallel Web Crawler 1. Introduction to Scala 2. Assessments 3. Other Books You May Enjoy Index

Scala infrastructure


First, let's have a look at the infrastructure developed for Scala. Let's have a look at the Scala interpreter first.

Scala interpreter

Although Scala is a compiled language, it has its own interpreter. It comes as part of the standard language distribution, and if you install Scala, you will have access to it. Please consult https://www.scala-lang.org/ on the instructions to install Scala.

You can access the interpreter from the command line by simply typing scala.

 

In this interpreter, you can run Scala expressions and get evaluations of them in real time. Besides ordinary expressions, you can run interpreter-specific expressions to tune it up. This kind of expression usually starts with a colon followed by a keyword. To access the list of all the relevant Scala interpreter expressions, type the following command:

:help

The output of the preceding command looks as follows:

SBT build tool

SBT is a build tool for Scala. It is a dedicated build tool developed specifically for Scala. It is possible to integrate Scala with Gradle or Maven, and in fact, this is an option that many teams prefer to do. SBT is supposed to be simple, but in fact, it is the precise opposite of simple. If you decide to use SBT as your Scala build tool, be advised that it possesses a complex infrastructure and is not well documented.

 

However, it is rather powerful. It allows you to write build descriptions in a subset of the Scala language. This means that your build scripts are Scala programs in themselves. This is not something you get with build tools, such as Gradle or Maven.

For this book, we do not need to be familiar with SBT. The GitHub repository with the examples for this books uses SBT, so you will need some basic familiarity with this software to run the examples. However, in this book, we do not feature SBT in parts that are crucial to functional programming. If you want to become more familiar with this tool, please see the official documentation of SBT.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime
Visually different images