Skip to content
/ fpinscala Public

Solution to the exercises of Functional Programming in Scala, from Mannig Publications

License

Notifications You must be signed in to change notification settings

iht/fpinscala

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build status Coverage Status

Functional Programming in Scala

This repository hosts my solutions to the exercises of the book Functional Programming in Scala, from Manning Publications.

The list of exercises and the official solutions can be found at https://github.com/fpinscala/fpinscala

Status

You can find the examples at src/main/scala, with a directory (Scala package) for each book chapter.

Tests

For each one of the exercises, I provide a test. Tests are stored in the directory src/test/scala, and you can reuse them for your exercises.

You will need sbt to run the tests and compile the exercises.

To compile the exercises before running the tests, simply run

> compile

If it's the first time, it will download all the necessary dependencies (basically, the Scala Specs2 library).

To run all the tests, simply execute the following in sbt

> test

To run a specific test, execute

> testOnly chapXX.ExYYSpec

where XX is the chapter number, and YY is the exercise number. For instance

> testOnly chap03.Ex10Spec

How to run (some of) the exercises

Some of the exercises can also be run as standalone applications.

To run the exercises in sbt, use

>  runMain package_name.object_name args

For instance

> runMain chap2.Ex02 5

Not all exercises can be run as applications. To check the output for some input values of all the exercises, you can add cases to the tests.

License

All the code hosted in this repository is distributed under the MIT license. See the license for more details.

About

Solution to the exercises of Functional Programming in Scala, from Mannig Publications

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages