From 2622e2756044d0c2b30d6590e1f3a15621b3e3e2 Mon Sep 17 00:00:00 2001 From: DiegoAlpizar <48010731+DiegoAlpizar@users.noreply.github.com> Date: Sun, 21 Apr 2019 10:10:01 -0600 Subject: [PATCH 1/5] Fix minor typo Replaces `'M'` to `'_'` as a placeholder in `partial` --- moses.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/moses.lua b/moses.lua index ccf628e..eeddf66 100644 --- a/moses.lua +++ b/moses.lua @@ -2421,7 +2421,7 @@ end function M.converge(f, g, h) return function(...) return f(g(...),h(...)) end end --- Partially apply a function by filling in any number of its arguments. --- One may pass a string `'M'` as a placeholder in the list of arguments to specify an argument +-- One may pass a string `'_'` as a placeholder in the list of arguments to specify an argument -- that should not be pre-filled, but left open to be supplied at call-time. -- @name partial -- @param f a function From e2af1724e160eeaf4165d850b77a8f0706297465 Mon Sep 17 00:00:00 2001 From: DiegoAlpizar <48010731+DiegoAlpizar@users.noreply.github.com> Date: Sun, 21 Apr 2019 10:24:26 -0600 Subject: [PATCH 2/5] Fix reject alias (discard) --- doc/tutorial.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/tutorial.md b/doc/tutorial.md index 035a77c..99249c9 100644 --- a/doc/tutorial.md +++ b/doc/tutorial.md @@ -456,7 +456,7 @@ M.select({1,2,3,4,5,6,7}, isOdd) -- => "{1,3,5,7}" ```` ### reject (t, f) -*Aliases: `reject`*. +*Aliases: `discard`*. Removes all values failing (returning false or nil) a validation test: From 72f2c620c26049f6c0f494e3794f2d3fdd3de340 Mon Sep 17 00:00:00 2001 From: DiegoAlpizar <48010731+DiegoAlpizar@users.noreply.github.com> Date: Sun, 21 Apr 2019 10:25:03 -0600 Subject: [PATCH 3/5] Fix minor typos --- doc/tutorial.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/tutorial.md b/doc/tutorial.md index 99249c9..49da8cd 100644 --- a/doc/tutorial.md +++ b/doc/tutorial.md @@ -2430,9 +2430,9 @@ The passed-in interceptor should be prototyped as `f(obj,...)`. ```lua local v = M.chain({1,2,3,4,5,6,7,8,9,10}) :filter(function(v) return v%2~=0 end) -- retain odd values - :tap(function(v) print('Max is', M.max(v) end) -- Tap max value + :tap(function(v) print('Max is', M.max(v)) end) -- Tap max value :map(function(v) return v^2 end) - :value() -- => Max is 89 + :value() -- => Max is 81 ```` ### has (obj, key) @@ -2448,7 +2448,7 @@ M.has(math,'random') -- => true ### pick (obj, ...) *Aliases: `choose`*. -Collects whilelisted properties of a given object. +Collects whitelisted properties of a given object. ```lua local object = {a = 1, b = 2, c = 3} From d58f78511fb984c9c76cc31481f1eff3dc76b394 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Alp=C3=ADzar?= <48010731+DiegoAlpizar@users.noreply.github.com> Date: Fri, 24 May 2019 20:12:33 -0600 Subject: [PATCH 4/5] Fix typos in curry example - Remove trailing ')' in sumOf3args(1)(2)(3)) call - Corrects curried call: replace "sumOf3args(1)(2)(3)" to "curried_sumOf3args(1)(2)(3)" --- doc/tutorial.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/tutorial.md b/doc/tutorial.md index 49da8cd..67f0c54 100644 --- a/doc/tutorial.md +++ b/doc/tutorial.md @@ -2225,8 +2225,8 @@ Curries a function. If the given function `f` takes multiple arguments, it retur ```lua local function sumOf3args(x,y,z) return x + y + z end local curried_sumOf3args = M.curry(sumOf3args, 3) -sumOf3args(1)(2)(3)) -- => 6 -sumOf3args(0)(6)(9)) -- => 15 +curried_sumOf3args(1)(2)(3) -- => 6 +curried_sumOf3args(0)(6)(9) -- => 15 ```` `n_args` defaults to 2. From 2142f3c0e659f8e718b473185c3fdde069bbe5f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Alp=C3=ADzar?= <48010731+DiegoAlpizar@users.noreply.github.com> Date: Fri, 24 May 2019 20:38:25 -0600 Subject: [PATCH 5/5] Fix typo in `bind2` example --- doc/tutorial.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/tutorial.md b/doc/tutorial.md index 67f0c54..a9f3865 100644 --- a/doc/tutorial.md +++ b/doc/tutorial.md @@ -1780,7 +1780,7 @@ sqrt2() -- => 1.4142135623731 Binds a value to be the second argument to a function. ```lua -local last2 = M.bind(M.last,2) +local last2 = M.bind2(M.last,2) last2({1,2,3,4,5,6}) -- => {5,6} ````