As @gitgithan noticed in #152, there is a problem in examples for lazy/eager evaluation. The problem appears because IO.orElse takes a block of code lazily so it should not be used as an example for eager evaluation 🤦 .
Here are the correct examples:
IO.delay(throw new Exception).orElse(IO.pure(2022)) // lazy, doesn't throw, returns 2022 when run
IO.pure(throw new Exception).orElse(IO.pure(2022)) // eager, throws before creating a value
As @gitgithan noticed in #152, there is a problem in examples for lazy/eager evaluation. The problem appears because
IO.orElse
takes a block of code lazily so it should not be used as an example for eager evaluation 🤦 .Here are the correct examples:
Closes #152