New
v0.6.0
- Do notation #97 (Special thanks to @tim-smart π)
- All the main types now have a
Do()constructor used to initialize a Do notation chain - Updated examples to use Do notation (new recommended API π―)
- All the main types now have a
/// Without the Do notation
String goShopping() => goToShoppingCenter()
.alt(goToLocalMarket)
.flatMap(
(market) => market.buyBanana().flatMap(
(banana) => market.buyApple().flatMap(
(apple) => market.buyPear().flatMap(
(pear) => Option.of('Shopping: $banana, $apple, $pear'),
),
),
),
)
.getOrElse(
() => 'I did not find π or π or π, so I did not buy anything π€·ββοΈ',
);
/// Using the Do notation
String goShoppingDo() => Option.Do(
($) {
final market = $(goToShoppingCenter().alt(goToLocalMarket));
final amount = $(market.buyAmount());
final banana = $(market.buyBanana());
final apple = $(market.buyApple());
final pear = $(market.buyPear());
return 'Shopping: $banana, $apple, $pear';
},
).getOrElse(
() => 'I did not find π or π or π, so I did not buy anything π€·ββοΈ',
);
- Added new
IOOptiontype - Added conversion methods from and to all classes (
IO,IOOption,IOEither,Task,TaskOption,TaskEither)- Removed
toTaskinIOEither(usetoTaskEitherinstead) β οΈ
- Removed
- Improved performance of
fpdart'ssortBylist extension #101 (thanks to @hbock-42 π) - Updated
pokeapi_functionalexample to Riverpod v2 #99 (thanks to @utamori π) - Updated repository folder structure #105