diff --git a/appendix_a.md b/appendix_a.md index 3cd3bfd7..d8729534 100644 --- a/appendix_a.md +++ b/appendix_a.md @@ -141,8 +141,8 @@ const maybe = curry((v, f, m) => { ## nothing ```js -// nothing :: () -> Maybe a -const nothing = () => Maybe.of(null); +// nothing :: Maybe a +const nothing = Maybe.of(null); ``` diff --git a/exercises/ch11/solution_a.js b/exercises/ch11/solution_a.js index ff5501db..0ea3424c 100644 --- a/exercises/ch11/solution_a.js +++ b/exercises/ch11/solution_a.js @@ -1 +1 @@ -const eitherToMaybe = either(_ => nothing(), Maybe.of); +const eitherToMaybe = either(always(nothing), Maybe.of); diff --git a/exercises/support.js b/exercises/support.js index 4dc02f83..56ebe432 100644 --- a/exercises/support.js +++ b/exercises/support.js @@ -579,7 +579,7 @@ const maybe = curry(function maybe(v, f, m) { return f(m.$value); }); -const nothing = function nothing() { return Maybe.of(null); }; +const nothing = Maybe.of(null); const reject = function reject(x) { return Task.rejected(x); };