Skip to content

Conversation

gidra5
Copy link

@gidra5 gidra5 commented Nov 25, 2019

No description provided.

Copy link
Member

@tshemsedinov tshemsedinov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can put that in a single line, remove unneeded round brackets

@gidra5
Copy link
Author

gidra5 commented Dec 8, 2019

You can put that in a single line, remove unneeded round brackets

When i remove brackets, I get error from eslint:
"Arrow function used ambiguously with a conditional expression no-confusing-arrow"

Is it ok?


const seq = f => g => x => 0;
const seq = f => g =>
((typeof g === 'number') ? f(g) : seq(x => f(g(x))));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
((typeof g === 'number') ? f(g) : seq(x => f(g(x))));
(typeof g === 'number' ? f(g) : seq(x => f(g(x))));

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

Successfully merging this pull request may close these issues.

2 participants