title: Why can't I pipe directly into Elixir String.length. Why do I have to wrap it in another function?
body: <p>Why doesn't this work:</p>
  
  <pre><code>iex(2)&gt; Enum.map(["the", "huge", "elephant"], String.length)
  ** (UndefinedFunctionError) function String.length/0 is undefined or private. 
  </code></pre>
  
  <p>But this does:</p>
  
  <pre><code>iex(2)&gt; Enum.map(["the", "huge", "elephant"], fn x -&gt; String.length(x) end) 
  [3, 4, 8]
  </code></pre>
  
  <p>I mean, String.length is a function, right? Just like my anonymous wrapper one? Or is it some kind of scoping issue as per the error message?</p>
  
  <p>My only experience with another functional(ish) language, is R, and this would work fine:</p>
  
  <pre><code>&gt; sapply(c("the", "huge", "elephant"), nchar)
       the     huge elephant 
         3        4        8 
  &gt; sapply(c("the", "huge", "elephant"), function(x) nchar(x))
       the     huge elephant 
         3        4        8 
  </code></pre>