diff --git a/packages/fpdart/lib/src/effect.dart b/packages/fpdart/lib/src/effect.dart index ee10bb2..7a69f5b 100644 --- a/packages/fpdart/lib/src/effect.dart +++ b/packages/fpdart/lib/src/effect.dart @@ -302,7 +302,6 @@ final class Effect extends IEffect { (exit) => switch (exit) { Left(value: final cause) => switch (cause) { Fail(error: final error) => Right(error), - Empty() => Left(cause), Die() => Left(cause), }, Right(value: final value) => Left(Fail(value)), @@ -319,7 +318,6 @@ final class Effect extends IEffect { (exit) => switch (exit) { Left(value: final cause) => switch (cause) { Fail(error: final error) => Left(Fail(f(error))), - Empty() => Left(cause), Die() => Left(cause), }, Right(value: final value) => Right(value), @@ -334,7 +332,6 @@ final class Effect extends IEffect { (exit) => switch (exit) { Left(value: final cause) => switch (cause) { Fail(error: final error) => Left(Fail(fl(error))), - Empty() => Left(cause), Die() => Left(cause), }, Right(value: final value) => Right(fr(value)), @@ -364,7 +361,6 @@ final class Effect extends IEffect { Fail(error: final error) => f(error)._unsafeRun(env).then( (_) => Left(Fail(error)), ), - Empty() => Left(cause), Die() => Left(cause), }, Right(value: final value) => Right(value), @@ -381,7 +377,6 @@ final class Effect extends IEffect { (exit) => switch (exit) { Left(value: final cause) => switch (cause) { Fail(error: final error) => orElse(error)._unsafeRun(env), - Empty() => Left(cause), Die() => Left(cause), }, Right(value: final value) => @@ -409,7 +404,6 @@ final class Effect extends IEffect { Left(value: final cause) => switch (cause) { Fail(error: final error) => Left(Die.current(onError(error))), - Empty() => Left(cause), Die() => Left(cause), }, Right(value: final value) => @@ -427,7 +421,6 @@ final class Effect extends IEffect { (exit) => switch (exit) { Left(value: final cause) => switch (cause) { Fail(error: final error) => f(error)._unsafeRun(env), - Empty() => Left(cause), Die() => Left(cause), }, Right(value: final value) => diff --git a/packages/fpdart/lib/src/exit.dart b/packages/fpdart/lib/src/exit.dart index aa6b3df..de225cf 100644 --- a/packages/fpdart/lib/src/exit.dart +++ b/packages/fpdart/lib/src/exit.dart @@ -4,23 +4,6 @@ typedef Exit = Either, R>; sealed class Cause implements Error { const Cause(); - Cause withTrace(StackTrace stack); -} - -/// Represents a lack of errors -final class Empty extends Cause { - @override - final StackTrace? stackTrace; - - const Empty([this.stackTrace]); - - @override - Empty withTrace(StackTrace stack) => stackTrace == null ? Empty(stack) : this; - - @override - String toString() { - return "Cause.Empty()"; - } } /// Failed as a result of a defect (unexpected error) @@ -36,10 +19,6 @@ final class Die extends Cause { factory Die.current(dynamic error, [StackTrace? stackTrace]) => Die(error, StackTrace.current, stackTrace); - @override - Die withTrace(StackTrace stack) => - stackTrace == null ? Die(error, defectStackTrace, stack) : this; - @override bool operator ==(Object other) => (other is Fail) && other.error == error; @@ -61,10 +40,6 @@ final class Fail extends Cause { const Fail(this.error, [this.stackTrace]); - @override - Fail withTrace(StackTrace stack) => - stackTrace == null ? Fail(error, stack) : this; - @override bool operator ==(Object other) => (other is Fail) && other.error == error;