Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/benhutchison/modesofcomposition
Lambdajam 2021 online workshop in Compositional Functional Programming in Scala
https://github.com/benhutchison/modesofcomposition
cats cats-effect functional-programming scala typelevel
Last synced: 3 months ago
JSON representation
Lambdajam 2021 online workshop in Compositional Functional Programming in Scala
- Host: GitHub
- URL: https://github.com/benhutchison/modesofcomposition
- Owner: benhutchison
- License: apache-2.0
- Created: 2020-05-16T23:39:23.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-07-04T13:37:18.000Z (7 months ago)
- Last Synced: 2024-10-09T02:40:22.103Z (4 months ago)
- Topics: cats, cats-effect, functional-programming, scala, typelevel
- Language: Scala
- Homepage:
- Size: 1.53 MB
- Stars: 6
- Watchers: 2
- Forks: 9
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Modes of composition
Workshop in Compositional Functional Programming in Scala, developed by Ben Hutchison (`[email protected]`)
## Workshop History
- Scheduled Lambdajam Online 2021, May 3 & 4, 10am
- Presented Lambdajam Online 2020, July 20 & 21 2020, 10am## Layout
The workshop consists of a [conceptual overview slidepack](ModesCompositionSlides.pdf) followed by a progression of structured, guided exercises
that illustrate how the concepts show up in practical code.Start with the [introduction slidepack](ModesCompositionSlides.pdf). Then each exercise should be attempted in order. The goal is to get the code to compile against the provided type signatures, and any associated unit tests to run green.
There is a PDF slidepack in each subdirectory containing:
- A statement of the problem
- How the exercise relates to broader principles covered in the workshop
- A Hints section with additional guidance & explanation, if required.Every exercise step has a corresponding solution directory with a complete working solution. You can check your answer against the provided solution, or if you get stuck you can look at the solution. Attempting a problem with only partial success, and then studiying the solution, can stimulate learning quite effectively.
- [Step1 Decoding an Order](./step1/) ( [step1 solution](./step1solution/) )
- [Step2 Validating an Order](./step2/) ( [step2 solution](./step2solution/) )
- [Step3 Processing Unavailable Order](./step3/) ( [step3 solution](./step3solution/) )
- [Step4 Processing Available Orders](./step4/) ( [step4 solution](./step4solution/) )
- [Step5 Procesing an Order Sream](./step5/) ( [step5 solution](./step5solution/) )## Getting Started
To do the hands on exercises you need existing familiarity with the Scala language and:
- JDK 8 or higher [installed](https://adoptopenjdk.net/installation.html)
- Scala Build Tool (SBT) [installed](http://www.scala-sbt.org/release/docs/Setup.html)
- An IDE such as [Intellij Community with Scala plugin](https://www.jetbrains.com/idea/download/) is recommendedThe project uses a number of libraries from the [Typelevel functional ecosystem](https://typelevel.org/). They will be automatically
downloaded by SBT but the process can take from 5-30 minutes. Therefore, once SBT is installed, enter the following in a terminal to ensure all libraries download and the code works as expected:```
> sbt
sbt> solution/test
```
Expect to see the libraries download, then compilation, and finally tests tun green.## Libraries Used
* [Cats](https://typelevel.org/cats/)
* [Cats Effect 3.x](https://typelevel.org/cats-effect/)
* [Circe](https://circe.github.io/circe/)
* [FS2 3.x](https://fs2.io/)
* [Refined](https://github.com/fthomas/refined)
* [Mouse](https://github.com/typelevel/mouse)