You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
||12 months ago|
|console||12 months ago|
|macro/src/main/scala/green/thisfieldwas/embracingnondeterminism/data||12 months ago|
|project||12 months ago|
|src||12 months ago|
|.gitignore||1 year ago|
|.scalafmt.conf||12 months ago|
|README.md||12 months ago|
|build.sbt||1 year ago|
This code accompanies a blog series covering functional programming idioms for managing nondeterminism and unknown states in production code. Please follow the series for a full explanation of the concepts represented by the code in this repository:
- Part 1: Contexts and Effects
- Part 2: Permitting or Halting Computation
- Part 3: Imperative Computation
Structure of the repository
Scala packages under
controlcontains the control-flow typeclasses such as
datacontains commonly-used contexts that Scala defines in its own Standard Library, such as
NonEmptyList. These code examples demonstrate different encodings of presence as the effects of operations and stand to illustrate how idioms in the series may be implemented across varying types. The
Semigrouptypeclasses are found here as well.
datapackage. These exist to highlight the value in using
Functoras a design pattern.
Scala packages under
controlcontains the laws definitions for the control-flow typeclasses.
datacontains specs for each of the effect types as well as "laws" tests which assert that the associated effect type is well-defined for particular typeclasses, such as
stdlibcontains property checks to illustrate how classes in the Scala Standard Library conform to typeclass laws themselves, and highlight that you, the reader of this series, have been using some of these concepts for some time.
utilcontains utility classes to aid in testing.
Import all project definitions by loading the following script after launching the console:
scala> :load console/imports.scala
This will pull all classes and implicits into scope so that you can work with them directly in the console and experiment with them yourself.