package generic

import "github.com/IBM/fp-go/pair/generic"

Index

Functions

func SequencePair

func SequencePair[
	MAP ~func(func(T1) func(T2) P.Pair[T1, T2]) func(HKT_T1) HKT_F_T2,
	AP1 ~func(HKT_T2) func(HKT_F_T2) HKT_PAIR,
	T1,
	T2,
	HKT_T1,
	HKT_T2,
	HKT_F_T2,
	HKT_PAIR any,
](
	fmap MAP,
	fap1 AP1,
	t P.Pair[HKT_T1, HKT_T2],
) HKT_PAIR

SequencePair is a utility function used to implement the sequence operation for higher kinded types based only on map and ap. The function takes a [Pair] of higher higher kinded types and returns a higher kinded type of a [Pair] with the resolved values.

func TraversePair

func TraversePair[
	MAP ~func(func(T1) func(T2) P.Pair[T1, T2]) func(HKT_T1) HKT_F_T2,
	AP1 ~func(HKT_T2) func(HKT_F_T2) HKT_PAIR,
	F1 ~func(A1) HKT_T1,
	F2 ~func(A2) HKT_T2,
	A1, T1,
	A2, T2,
	HKT_T1,
	HKT_T2,
	HKT_F_T2,
	HKT_PAIR any,
](
	fmap MAP,
	fap1 AP1,
	f1 F1,
	f2 F2,
	t P.Pair[A1, A2],
) HKT_PAIR

TraversePair is a utility function used to implement the sequence operation for higher kinded types based only on map and ap. The function takes a [Pair] of base types and 2 functions that transform these based types into higher higher kinded types. It returns a higher kinded type of a [Pair] with the resolved values.

Source Files

sequence.go

Version
v1.0.151 (latest)
Published
Nov 23, 2024
Platform
linux/amd64
Imports
2 packages
Last checked
4 months ago

Tools for package owners.