mirror of
https://github.com/IBM/fp-go.git
synced 2025-06-19 00:17:48 +02:00
fix: initial implementation of types
Signed-off-by: Carsten Leue <carsten.leue@de.ibm.com>
This commit is contained in:
@ -105,6 +105,10 @@ func MonadMap[GA ~[]A, GB ~[]B, A, B any](as GA, f func(a A) B) GB {
|
||||
return array.MonadMap[GA, GB](as, f)
|
||||
}
|
||||
|
||||
func Map[GA ~[]A, GB ~[]B, A, B any](f func(a A) B) func(GA) GB {
|
||||
return F.Bind2nd(MonadMap[GA, GB, A, B], f)
|
||||
}
|
||||
|
||||
func Size[GA ~[]A, A any](as GA) int {
|
||||
return len(as)
|
||||
}
|
||||
|
Reference in New Issue
Block a user