fpdart 2.0.0-dev.1 fpdart: ^2.0.0-dev.1 copied to clipboard
Functional programming in Dart and Flutter. All the main functional programming types and patterns fully documented, tested, and with examples.
import 'package:fpdart/fpdart.dart';
typedef Env = ({String url, int seed});
typedef Error = String;
typedef Success = int;
final either = Right<Error, Success>(10);
final option = Some(10);
final effect = Effect<Env, Error, Success>.gen(($) {
final eitherValue = $.sync(either);
final optionValue = $.sync(option);
return eitherValue + optionValue;
});