As part of the some FP mentoring sesions we have developed a very simple project (in Scala, Kotlin and Swift) that basically shows how to express the behavior of your program using type classes: Combinator
, Transformer
, Lifter
and Flattener
, which are basically a simpler version of Semigroup
, Functor
, Applicative
and Monad
.
- Step 0: Foundations
- Step 1: Create data type Maybe
- Step 2: Create type class Combinator
- Step 3: Add syntax for Combinator
- Step 4: Create type class Transformer (with syntax)
- Step 5: Create type class Transformer2
- Step 6: Create type class Lifter
- Step 7: Create type class Flattener
- Step 8: Use monadic structure
- Step 9: Use Option
- Step 10: Generic F-program
- Step 0: Foundations
- Step 1: Create data type Maybe
- Step 2: Create type class Combinator
- Step 3: Add syntax for Combinator
- Step 4: Create type class Transformer (with syntax)
- Step 5: Create type class Transformer2
- Step 6: Create type class Lifter
- Step 7: Create type class Flattener
- Step 8: Use monadic structure
- Step 9: Use Option
- Step 10: Generic F-program
- Step 0: Foundations
- Step 1a: Create data type Maybe
- Step 1b: add HKT support to Maybe<A>
- Step 2: Create typeclass Combinator
- Step 3: Create Transformer type class
- Step 4: Create Transformer2 type class
- Step 5: Create typeclass Lifter
- Step 6: Create typeclass Flattener
- Step 7: Use Option
- Step 8: Generic F-program
- Step 0: Foundations
- Step 1a: Create data type Maybe
- Step 1b: Create data type Maybe with HKT support
- Step 2: Create type class Combinator
- Step 4: Create type class Transformer
- Step 5: Create type class Transformer2
- Step 6: Create type class Lifter
- Step 7: Create type class Flattener
- Step 9: Use Option
- Step 10: Generic F-program