record

package
v1.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 21, 2023 License: Apache-2.0 Imports: 8 Imported by: 12

Documentation

Overview

Copyright (c) 2023 IBM Corp. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Collect

func Collect[K comparable, V, R any](f func(K, V) R) func(map[K]V) []R

func ConstNil

func ConstNil[K comparable, V any]() map[K]V

ConstNil return a nil map

func DeleteAt

func DeleteAt[K comparable, V any](k K) func(map[K]V) map[K]V

func Empty

func Empty[K comparable, V any]() map[K]V

func Eq

func Eq[K comparable, V any](e E.Eq[V]) E.Eq[map[K]V]

func Filter

func Filter[K comparable, V any](f func(K) bool) func(map[K]V) map[K]V

Filter creates a new map with only the elements that match the predicate

func FilterMap

func FilterMap[K comparable, V1, V2 any](f func(V1) O.Option[V2]) func(map[K]V1) map[K]V2

FilterMap creates a new map with only the elements for which the transformation function creates a Some

func FilterMapWithIndex

func FilterMapWithIndex[K comparable, V1, V2 any](f func(K, V1) O.Option[V2]) func(map[K]V1) map[K]V2

FilterMapWithIndex creates a new map with only the elements for which the transformation function creates a Some

func FilterWithIndex

func FilterWithIndex[K comparable, V any](f func(K, V) bool) func(map[K]V) map[K]V

FilterWithIndex creates a new map with only the elements that match the predicate

func FromEntries

func FromEntries[K comparable, V any](fa []T.Tuple2[K, V]) map[K]V

func Has

func Has[K comparable, V any](k K, r map[K]V) bool

func IsEmpty

func IsEmpty[K comparable, V any](r map[K]V) bool

func IsNil

func IsNil[K comparable, V any](m map[K]V) bool

IsNil checks if the map is set to nil

func IsNonEmpty

func IsNonEmpty[K comparable, V any](r map[K]V) bool

func IsNonNil

func IsNonNil[K comparable, V any](m map[K]V) bool

IsNonNil checks if the map is set to nil

func Keys

func Keys[K comparable, V any](r map[K]V) []K

func Lookup

func Lookup[K comparable, V any](k K) func(map[K]V) O.Option[V]

func Map

func Map[K comparable, V, R any](f func(V) R) func(map[K]V) map[K]R

func MapRef

func MapRef[K comparable, V, R any](f func(*V) R) func(map[K]V) map[K]R

func MapRefWithIndex

func MapRefWithIndex[K comparable, V, R any](f func(K, *V) R) func(map[K]V) map[K]R

func MapWithIndex

func MapWithIndex[K comparable, V, R any](f func(K, V) R) func(map[K]V) map[K]R

func MonadMap

func MonadMap[K comparable, V, R any](r map[K]V, f func(V) R) map[K]R

func MonadMapRef

func MonadMapRef[K comparable, V, R any](r map[K]V, f func(*V) R) map[K]R

func MonadMapRefWithIndex

func MonadMapRefWithIndex[K comparable, V, R any](r map[K]V, f func(K, *V) R) map[K]R

func MonadMapWithIndex

func MonadMapWithIndex[K comparable, V, R any](r map[K]V, f func(K, V) R) map[K]R

func Reduce

func Reduce[K comparable, V, R any](f func(R, V) R, initial R) func(map[K]V) R

func ReduceRef

func ReduceRef[K comparable, V, R any](f func(R, *V) R, initial R) func(map[K]V) R

func ReduceRefWithIndex

func ReduceRefWithIndex[K comparable, V, R any](f func(K, R, *V) R, initial R) func(map[K]V) R

func ReduceWithIndex

func ReduceWithIndex[K comparable, V, R any](f func(K, R, V) R, initial R) func(map[K]V) R

func Sequence

func Sequence[K comparable, A, HKTA, HKTAA, HKTRA any](
	fof func(map[K]A) HKTRA,
	fmap func(func(map[K]A) func(A) map[K]A) func(HKTRA) HKTAA,
	fap func(HKTA) func(HKTAA) HKTRA,
	ma map[K]HKTA) HKTRA

HKTA = HKT[A] HKTAA = HKT[func(A)map[K]A] HKTRA = HKT[map[K]A]

func Singleton

func Singleton[K comparable, V any](k K, v V) map[K]V

func Size

func Size[K comparable, V any](r map[K]V) int

func ToArray

func ToArray[K comparable, V any](r map[K]V) []T.Tuple2[K, V]

func ToEntries

func ToEntries[K comparable, V any](r map[K]V) []T.Tuple2[K, V]

func Traverse

func Traverse[K comparable, A, B, HKTB, HKTAB, HKTRB any](
	fof func(map[K]B) HKTRB,
	fmap func(func(map[K]B) func(B) map[K]B) func(HKTRB) HKTAB,
	fap func(HKTB) func(HKTAB) HKTRB,
	f func(A) HKTB) func(map[K]A) HKTRB

HKTA = HKT<A> HKTB = HKT<B> HKTAB = HKT<func(A)B> HKTRB = HKT<map[K]B>

func TraverseWithIndex

func TraverseWithIndex[K comparable, A, B, HKTB, HKTAB, HKTRB any](
	fof func(map[K]B) HKTRB,
	fmap func(func(map[K]B) func(B) map[K]B) func(HKTRB) HKTAB,
	fap func(HKTB) func(HKTAB) HKTRB,

	f func(K, A) HKTB) func(map[K]A) HKTRB

func Union

func Union[K comparable, V any](m Mg.Magma[V]) func(map[K]V) func(map[K]V) map[K]V

func UnionMonoid

func UnionMonoid[K comparable, V any](s S.Semigroup[V]) M.Monoid[map[K]V]

func UnionSemigroup

func UnionSemigroup[K comparable, V any](s S.Semigroup[V]) S.Semigroup[map[K]V]

func UpsertAt

func UpsertAt[K comparable, V any](k K, v V) func(map[K]V) map[K]V

func Values

func Values[K comparable, V any](r map[K]V) []V

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL