Skip to content
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

Add named versions of the standard F#x operators #52

Open
forki opened this issue Mar 30, 2012 · 10 comments
Open

Add named versions of the standard F#x operators #52

forki opened this issue Mar 30, 2012 · 10 comments

Comments

@forki
Copy link
Member

forki commented Mar 30, 2012

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.

@panesofglass
Copy link
Contributor

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.

@mausch
Copy link
Member

mausch commented Mar 30, 2012

@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

@7sharp9
Copy link
Member

7sharp9 commented Nov 30, 2012

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.

@mausch
Copy link
Member

mausch commented Nov 30, 2012

@7sharp9 Do you agree with the tentative names I proposed? Are there any other operators I didn't include?

@7sharp9
Copy link
Member

7sharp9 commented Nov 30, 2012

@mausch I think so, they seen sensible to me.

@7sharp9
Copy link
Member

7sharp9 commented Nov 30, 2012

@mausch I know they wont be as pretty as infix symbolics, its a pity we don't have infix function declarations.

@7sharp9
Copy link
Member

7sharp9 commented Nov 30, 2012

@mausch theres also (>>.)

If you include the ones in the Nullable module:

(+?), (-?), ( *?), (/?), (>?), (>=?), (<?), (<=?)

@mausch
Copy link
Member

mausch commented Nov 30, 2012

@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

@mausch
Copy link
Member

mausch commented Nov 30, 2012

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 :)

@panesofglass
Copy link
Contributor

👍 for *Back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants