Understanding the Return Type of Effect/Option's `tap()` Function
Hello all,
I have a piece of code that looks like this:
There Effect/Option package defines a
However, the
My question is, why does the function parameter
I have a piece of code that looks like this:
There Effect/Option package defines a
tap() function which has basically the same functionality. My idea was to replace the previous code with the following:However, the
f function parameter in tap() is defined as returning an Option (as can be seen here: https://github.com/Effect-TS/effect/blob/126133b106a52166bf21515a7bfa7779c1bdbbde/packages/effect/src/Option.ts#L787-L790).My question is, why does the function parameter
f: (a: A) => Option<_> have a return type? Shouldn't the return type be void?