Skip to content
This repository has been archived by the owner on Jul 25, 2018. It is now read-only.

fix test #5

Open
mesteche opened this issue Feb 20, 2018 · 0 comments
Open

fix test #5

mesteche opened this issue Feb 20, 2018 · 0 comments

Comments

@mesteche
Copy link

In your test of the fix combinator, I think you don't actually test the combinator since f is redefined inside it's anonymous parent function. Maybe try replacing this:

const result = fix((f) => {
                return function f(n) {
                    return n === 0 ? 1 : n * f(n - 1);
                };
})(5);

with this:

const result = fix(f => n => n === 0 ? 1 : n * f(n - 1))(5);
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant