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 more options for no-unused-expression rule #27

Open
tunnckoCore opened this issue Jul 28, 2017 · 1 comment
Open

Add more options for no-unused-expression rule #27

tunnckoCore opened this issue Jul 28, 2017 · 1 comment

Comments

@tunnckoCore
Copy link

Currently, i almost don't see how it can be used, even in FP. It's true that i'm not so fully FP, not so hardcore FP, but it fails for simple things like asserting. Isn't it too aggressive?

Can you should some "real" examples that may pass that rule? It's pretty cool and i like it, mostly.

@graingert
Copy link
Collaborator

graingert commented Jul 31, 2017

@charlike instead of assertions you need to use the Validation applicative functor.

const result = validation.bind(function(val) {
	if (val == "hi") {
		return Validation.success("world")
	} else {
		return Validation.fail("wow, you really failed.")
	}
});

It's true that i'm not so fully FP, not so hardcore FP

then this rule-set is not for you.

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

2 participants