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

Should fmap use <§> for consistency with function application: §? #159

Closed
ryanbooker opened this issue Jan 19, 2015 · 12 comments
Closed

Comments

@ryanbooker
Copy link
Contributor

In Haskell, I think <$> was chosen for fmap, because $ is used for function application. Perhaps this consistency should be brought to Swiftz's fmap.

Should fmap use <§> for consistency with function application: §?

@ryanbooker ryanbooker changed the title Should fmap use <§> for consistency with function application: §? Should fmap use <§> for consistency with function application: §? Jan 19, 2015
@sharplet
Copy link
Contributor

I wish <§> wasn't such hell to type 😞

@CodaFi
Copy link
Member

CodaFi commented Jan 19, 2015

I use <%> in the basis because it was the closest thing to <$> on the keyboard. I wonder what other languages with Applicative Functors do.

@pthariensflame
Copy link
Member

I think I like <§> rather than <$>, for the reasons cited in the OP. That being said, I'll go with whatever is most comfortable with the general populace of our users, since Swiftz is above all else supposed to be usable. :)

@ryanbooker
Copy link
Contributor Author

re: the "hard to type" fear, § is just as easy to type as $, ^ or %… it's ⌥ 6 (Option 6) on a Mac keyboard. I suspect we'd get used to typing it very quickly. Just an idea. I guess switch from a shift to option is a small pain. :)

@pthariensflame
Copy link
Member

Option-5, for me, since I'm using U.S. Extended. :)

@ryanbooker
Copy link
Contributor Author

Ah, fair enough. I suppose it may be cumbersome for some language keyboards?

@sharplet
Copy link
Contributor

@pthariensflame Actually what I was getting at was that you have to switch modifier keys and back again: Shift-, - Opt-6 - Shift-.. I personally find it quite cumbersome, but maybe I'm doing it wrong? Compared to <*>, <%>, or <^>, where you can just hold down shift and you're off to the races.

@sharplet
Copy link
Contributor

But I'm also a big fan of the consistency argument, so really I'm just torn!

@pthariensflame
Copy link
Member

@sharplet You can have your thumb (of either hand) on Option while your pinky finger (also of either hand) is on Shift. This is generally what I do, and it works pretty well (it's also agnostic to your particular keyboard layout, since the MOD keys aren't going to move).

@CodaFi
Copy link
Member

CodaFi commented Jan 20, 2015

As an aside: we really should radar for the use of $ in operator identifiers. It's ridiculous that the language designers get to have it all to themselves just because they use it for one feature.

Dupe'able at rdar://19528489

@pthariensflame
Copy link
Member

Thanks, @CodaFi!

@CodaFi
Copy link
Member

CodaFi commented Aug 19, 2015

This thread should be moved into typelift/Operadics. I'm going to close it here. If there's any interest reopen it over there.

@CodaFi CodaFi closed this as completed Aug 19, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants