Numbered block parameters in Ruby
I understand the author&#x27;s position, and despite its usefulness, I think the numbered arguments are an inelegant solution. In Haskell, by way of comparison, any one-parameter function can be used as the argument to map:<p><pre><code>  ghci&gt; map reverse [&quot;hello&quot;, &quot;goodbye&quot;]
  [&quot;olleh&quot;,&quot;eybdoog&quot;]
</code></pre>
is (mostly) equivalent to the more verbose form with an explicit lambda:<p><pre><code>  ghci&gt; map (\s -&gt; reverse s) [&quot;hello&quot;, &quot;goodbye&quot;]
  [&quot;olleh&quot;,&quot;eybdoog&quot;]
</code></pre>
Operators are just normal functions, but tuples are not automatically uncurried. Here I&#x27;m using the multiply operator (*) to multiple a list of pairs:<p><pre><code>  ghci&gt; map (*) [(1,2), (3,4)]
  ERROR
  ghci&gt; map (uncurry (*)) [(1,2), (3,4)]
  [2,12]
</code></pre>
Points-free syntax can be used to construct chains of operations without any explicit lambda variable. Here filter strings of more than two characters:<p><pre><code>  ghci&gt; filter ((&gt;2) . length) [&quot;a&quot;,&quot;bb&quot;,&quot;ccc&quot;,&quot;dddd&quot;]
  [&quot;ccc&quot;,&quot;dddd&quot;]
</code></pre>
In lambda syntax:<p><pre><code>  ghci&gt; filter (\x -&gt; (length x) &gt; 2) [&quot;a&quot;,&quot;bb&quot;,&quot;ccc&quot;,&quot;dddd&quot;]
  [&quot;ccc&quot;,&quot;dddd&quot;]
</code></pre>
I find the Haskell syntax concise and clear, and I always miss it when using other languages (despite Haskell&#x27;s other shortcomings).<p>Edit: formatting