Add named versions of the standard F#x operators
We have a lot of cool operators in F#x. Let's try to give them names and add the named vbersions to the prelude (or the monads).
Pull request are welcome on this issue.
I agree. I wonder if this couldn't be done in conjunction with finishing the pull request for type classes? We really should finish that one out.
@panesofglass It's nagging me too, but I think they're independent issues...
BTW I agree with this too. It's more than just a convenience, it's a necessity in the current design because we can only have one set of operators open at a time (i.e. >=> only for one monad). This is not the case with Gustavo's fork because it actually overloads the operators.
We already have <!> map, <*> ap, >>= bind.
Missing (with tentative names): =<< bindl, >=> kleislir, <=< kleislil, *> apr, <* apl, >> combine
I almost never use symbolics as I like to have the option of intellisense. When you come back to code you have written previously its really annoying to not be able to see the function signature of the symbolics. Or having to alias the symbolic back to a named function so you can.
@7sharp9 Do you agree with the tentative names I proposed? Are there any other operators I didn't include?
@mausch I think so, they seen sensible to me.
@mausch I know they wont be as pretty as infix symbolics, its a pity we don't have infix function declarations.
@mausch theres also (>>.)
If you include the ones in the Nullable module:
(+?), (-?), ( *?), (/?), (>?), (>=?), (<?), (<=?)
@7sharp9 >>. is actually combine, I forgot the dot in that message, as >> is obviously the built-in composition operator.
About the Nullable module, since F# 3.0 already has operators around Nullable and they're much better than the ones in this module, these operators are pretty much deprecated. I'll remove them when we upgrade to FSharp.Core 4.3 / 2.3
Revisiting this issue, I'm having second thoughts about those names... here are some other suggestions:
=<< bindBack (which fits with List.foldBack, scanBack, etc)
or =<< bindLeft
>=> kleisli
and <=< kleisliBack or kleisliLeft
*> apRight and <* apLeft
So yeah, bikeshedding :)
:+1: for *Back.