mapping)
+ => @this.Map(mapping);
+
+ public static Func SelectMany(this Func @this, Func> binding, Func project)
+ => () =>
+ {
+ var t = @this();
+ var r = binding(t).Invoke();
+ return project(t, r);
+ };
+
+ #endregion
+}
\ No newline at end of file
diff --git a/Sanchime.Functional/Core/Extensions/IEnumerable.cs b/Sanchime.Functional/Core/Extensions/IEnumerable.cs
index e757fa2..1bf9a10 100644
--- a/Sanchime.Functional/Core/Extensions/IEnumerable.cs
+++ b/Sanchime.Functional/Core/Extensions/IEnumerable.cs
@@ -1,5 +1,4 @@
using System.Collections.Immutable;
-using Sanchime.Functional.Core.Options;
using Sanchime.Functional.Core.Products;
namespace Sanchime.Functional.Core.Extensions;
diff --git a/Sanchime.Functional/Core/Extensions/Identity.cs b/Sanchime.Functional/Core/Extensions/Identity.cs
index dc7901d..df70ba3 100644
--- a/Sanchime.Functional/Core/Extensions/Identity.cs
+++ b/Sanchime.Functional/Core/Extensions/Identity.cs
@@ -8,5 +8,5 @@ public static class IdentityExtension
=> () => mapping(@this());
public static Identity Bind(this Identity @this, Func> binding)
- => binding(@this()).Invoke();
+ => () => binding(@this()).Invoke();
}
diff --git a/Sanchime.Functional/Core/Extensions/Option.cs b/Sanchime.Functional/Core/Extensions/Option.cs
index d44b6cb..0c838b1 100644
--- a/Sanchime.Functional/Core/Extensions/Option.cs
+++ b/Sanchime.Functional/Core/Extensions/Option.cs
@@ -1,5 +1,3 @@
-using System;
-using Sanchime.Functional.Core.Options;
using Sanchime.Functional.Core.Products;
namespace Sanchime.Functional.Core.Extensions;
diff --git a/Sanchime.Functional/Core/Eithers/Either.cs b/Sanchime.Functional/Core/Products/Either.cs
similarity index 96%
rename from Sanchime.Functional/Core/Eithers/Either.cs
rename to Sanchime.Functional/Core/Products/Either.cs
index 8de5b80..669ea9c 100644
--- a/Sanchime.Functional/Core/Eithers/Either.cs
+++ b/Sanchime.Functional/Core/Products/Either.cs
@@ -1,6 +1,4 @@
-using Sanchime.Functional.Core.Products;
-
-namespace Sanchime.Functional.Core.Eithers;
+namespace Sanchime.Functional.Core.Products;
public static class Either
{
diff --git a/Sanchime.Functional/Core/Options/Option.cs b/Sanchime.Functional/Core/Products/Option.cs
similarity index 97%
rename from Sanchime.Functional/Core/Options/Option.cs
rename to Sanchime.Functional/Core/Products/Option.cs
index d3cd9a9..e33f560 100644
--- a/Sanchime.Functional/Core/Options/Option.cs
+++ b/Sanchime.Functional/Core/Products/Option.cs
@@ -1,6 +1,4 @@
-using Sanchime.Functional.Core.Products;
-
-namespace Sanchime.Functional.Core.Options;
+namespace Sanchime.Functional.Core.Products;
///
/// 的状态