New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Map aliases #1315
Map aliases #1315
Conversation
I am not opposed to To make this change, however, we would need:
Anyone else have thoughts on this? |
Clarification: I am opposed to the symbolic aliases. Developers outside FP complain loudly about these, and unlike, e.g., |
I quite liked |
I like |
👍 on |
All right, so it looks like we're:
|
Alright, thanks for the input! I will adjust the PR as soon as I have some spare time :) |
b41047a
to
09abf7d
Compare
Also for consistency (principle of least surprise):
|
@jdegoes Ready to review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some other const
functions defined in ZManaged
, Gen
, Assertion
, Exit
, Fiber
, FunctionIO
, Runtime
and STM
. I think we better change them all at once?
@ghostdogpr Added Also, reordered combinators as you asked. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Just one remark left in Exit
.
@ghostdogpr Ready |
@ioleo thanks for the suggestion & implementation! |
This proposition consists of two parts:
as
andasError
operators.Similar to
*>
and<*
operators, sometimes we just don't care about the value in the success/error channel and wish to replace it. With these operators, we can express that more clearly.map
,mapError
,as
andasError
.The symbolic aliases are more readable when chaining lots of operations.
The choice of symbols is somewhat arbitrary. Among many alternatives I propose these (
+>
,*+>
,#>
,*#>
) follwing this reasoning:>
indicates the direction of the flow, similar to*>
operator+
and#
indicates the channel being mapped (respectively success and error)*
prefix indicates the previous value is being ignored, similar to*>
operatorI'm open to discuss alternatives.