1
0
mirror of https://github.com/IBM/fp-go.git synced 2025-08-10 22:31:32 +02:00

fix: remove types from this branch

Signed-off-by: Dr. Carsten Leue <carsten.leue@de.ibm.com>
This commit is contained in:
Dr. Carsten Leue
2023-08-29 09:11:03 +02:00
parent 1a0c40b419
commit b5f077da71
9 changed files with 3 additions and 440 deletions

View File

@@ -98,7 +98,7 @@ func MapRefWithIndex[K comparable, V, R any](f func(K, *V) R) func(map[K]V) map[
}
// Lookup returns the entry for a key in a map if it exists
func Lookup[K comparable, V any](k K) func(map[K]V) O.Option[V] {
func Lookup[V any, K comparable](k K) func(map[K]V) O.Option[V] {
return G.Lookup[map[K]V](k)
}

View File

@@ -71,8 +71,8 @@ func TestLookup(t *testing.T) {
"b": "b",
"c": "c",
}
assert.Equal(t, O.Some("a"), Lookup[string, string]("a")(data))
assert.Equal(t, O.None[string](), Lookup[string, string]("a1")(data))
assert.Equal(t, O.Some("a"), Lookup[string]("a")(data))
assert.Equal(t, O.None[string](), Lookup[string]("a1")(data))
}
func TestFilterChain(t *testing.T) {