Skip to Main Content
Mastering Functional Programming
book

Mastering Functional Programming

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

Server-side programming

For the purposes of server-side programming, we will be using libraries called HTTP4S and Circe. HTTP4S is a library with which you can bootstrap an HTTP server, accept requests, and define how to respond to them. Circe is a library with which you can convert JSON strings to domain objects.

HTTP4S leverages IO under the hood so that it can be nicely integrated into our existing database infrastructure that outputs IO, as well as so that we can be sure that our server runs asynchronously. Circe uses a technique of compile-time programming via macros (which we have already discussed briefly) to define how to convert JSON strings into Scala case classes or traits.

We are going to bootstrap our server as follows:

BlazeBuilder[IO] ...
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
Functional Programming in Scala

Functional Programming in Scala

Runar Bjarnason, Paul Chiusano

Publisher Resources

ISBN: 9781788620796Supplemental Content