dartz
dartz copied to clipboard
Functional programming in Dart
Unhandled Exception: 'package:bloc/src/emitter.dart': Failed assertion: '!_isCompleted' emit was called after an event handler completed normally. This is usually due to an unawaited future in an event handler. Please make sure...
I have been going through a refactoring stage of a code base and looking through a list of snippets like: ``` Either get failureOrUnit => value.fold( (l) => left(l), (r)...
For your consideration. I've had a few situations where this constructor would be handy.
I just realized I really goofed up the `flatTap` signature when I implemented it a while back. This fixes the signature so the dependent task takes the computed value as...
Sometimes I want to run asynchronous operations inside a `.flatMap` call. For that I'd suggest adding a `.flatMapAsync()` method to be able to call `await` inside the callback function. I...
It is often the case that the value `A` in `Option.when` cannot be constructed if the predicate is false. Example: ```dart final headOption = Option.when(list.isNotEmpty, list.first); // this throws ```...
Like `catching`, but for `async` function bodies. Usage: ```dart Future doAsyncThings() { return catchAsync(() async { final foo = await asyncAction(); final bar = await asyncAction(); return foo + bar;...
Closes #105. Allows to use `catchAsync` in place of `catching` for asynchronous contexts. Example usage: ```dart Future doAsyncThings() { return catchAsync(() async { final foo = await asyncAction(); final bar...
it would be nice to have getOrNull in Either class, similar to getOrdElse