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

[Discussion] Why are you offering so many aliases? #173

Open
tho-graf opened this issue Jun 17, 2018 · 3 comments
Open

[Discussion] Why are you offering so many aliases? #173

tho-graf opened this issue Jun 17, 2018 · 3 comments

Comments

@tho-graf
Copy link

Hi there,
I played a little bit around with monet.js and really like it.

There is only one thing, I think, creates more problems when working with a team on a codebase than it solves. So many different aliases for the same thing. I know, that depending on the library or language, there are different names for it. But at least the one codebase is consistent.

Sure, you can specify some conventions -- but why add conventions if you don't need them.

I would like to hear your opinion on that.

Thanks,
Thomas

@ulfryk
Copy link
Member

ulfryk commented Jun 17, 2018

Good point @thomaskempel :)

If you are thinking about bind / chain / flatMap alises then answer is simple. Name defined by Monad definition is bind and it's used in other libraries for monads, so we need to have it. In FantasyLand it's defined as chain -- monet aims to be fantasy land compliant so we need chain. And last one -> flatMap is probably most commonly used one in many libraries so 3rd alias is needed.

when working with a team on a codebase

So probably each team, on each codebase should decide which convention is most common for their set of libs and depend on code review / linting to ensure that everyone uses the chosen convention.

On the other hand there is Just/Some + None/Nothing - and here I have no answer. Probably in 1.0.0 version there will be only one of them.

@tho-graf
Copy link
Author

Thanks for the insights and your thoughts.

This is just my opinion, but I think that the best solution (for beginners of fp -- there are a lot at the moment, including me -- and even for advanced programmers) would be to have only one API, everything else is just a unnecessary cognitive load (to learn, to use, to read and to teach all aliases), which finally leads to an accidental complexity in our codebases.

The most reasonable API -- for me -- would be to align with the FantasyLand specs, because their goal is to unify.

@shea-parkes
Copy link

Although I agree that one name for each concept would be best, I actually appreciate all the aliases in this case since they accurately reflect the inconsistencies in the broader community.

Ultimately, I'm fine either way; I just wanted to share another perspective. Thanks for the clean library!

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

3 participants