An example of a web app, written in Scala, using pure functional programming concepts.
The goal for this project is to demonstrate how to build an application using FP techniques in Scala. Coming from an OO background to Scala can be very hard and this project can hopefully ease the burden for some people.
- Http4s the web server
- Circe for json serialization
- Doobie for database access
- Cats for pure FP
- ScalaTest for testing
- PureConfig for app config
- Tagless Final for the core domain.
The core domain of this project uses F[_] in a lot of places. F[_] is a higher kinded type and represents a type that abstracts over a type that holds another type, i.e. List and Option.
When using F[_] we want to express that evaluation is suspended into "some effect type". This can provide referential transparency even for otherwise side-effectful code, and helps us reason about the codebase.
We can leave the effect type abstract, and bind it only at the edge of our application, when we bootstrap the Server.
This enables us to swap out the used effect system with relative ease, if we so desire.