functional-programming-is-boring
functional-programming-is-boring copied to clipboard
A short course on Functional Programming in Typescript
:egg: Functional Programming Is Boring :egg:
A completely OK short course on FP for Bulb Engineers.
Click on the words for information about subjects and things.
Part 1
Lesson 1 - Option
Lesson 2 - Either
Lesson 3 - Optics
Lesson 4 - TaskEither
Lesson 5 - Parsers
Lesson 6 - Validation
Exercises
If you'd like to practise using fp-ts
in the wild, here are some exercises
along with unit tests that you can use to increase your 10x-ing.
The tests for each unit are currently skipped, but can be enabled by removing
skip
from the matching test file.
Datatypes
These exercises are for specific types that you will find in fp-ts
.
Control flow types
Stateful types
Typeclasses
After we've used a few datatypes we'll start to notice the same old functions (such as map
) coming up over and over. These interfaces, reused between many types, are called typeclasses, these exercises are to help gain a better intuition for them by implementing their functions yourself.
Exercises
Examples
Some more concrete examples of FP in the wild (please feel free to contribute here if you find something worth sharing)
Option | Either | io-ts validator | Store Comonad | Parser | newtypes | dependency injection with Reader
Installing stuff
The exercises are in Typescript and be run as such:
yarn install
# tests
yarn test:watch
# typechecker
yarn typescript:watch
The tests for each exercise live in src/tests
, and are all skipped, enable the ones you want to try.