The name of the function method, which is dual to reduce or inject.

Asked 2 years ago, Updated 2 years ago, 117 views

For convolution functions, various names are used for each programming language and argument type, such as fold, reduce, inject, etc., but what are the names of the two functions?fold has unfold corresponding (F#, Haskell), but I don't know the name of the function corresponding to reduce, inject.

I asked because I thought it was necessary to find these functions and define them myself.

Supplement:unfold Specifications
Seq.unfold in F# is a function that takes the function f and the initial state s as arguments and returns the sequence; f is a function that returns the sequence as option.
The same goes for Haskell's unfoldr.

english

2022-09-30 14:05

1 Answers

If it is not included in the official library, I think there is probably no standard name for it.Especially as far as I know,

reduce->python
injection->ruby

However, compared to F# and Haskell, the functional color is lighter, so I think that's what happened.

Recently, Java Stream seems to have implemented unfold equivalent features, but since it is Stream.iterate, it may be relatively different depending on the library implementation.


2022-09-30 14:05

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.