title: Scala currying vs partially applied functions
body: <p>I realize that there are several questions on here about <strong><em>what</em></strong> currying and partially applied functions are, but I'm asking about how they are different. As a simple example, here is a curried function for finding even numbers:</p>
  
  <pre><code>def filter(xs: List[Int], p: Int =&gt; Boolean): List[Int] =
     if (xs.isEmpty) xs
     else if (p(xs.head)) xs.head :: filter(xs.tail, p)
     else filter(xs.tail, p)
  
  def modN(n: Int)(x: Int) = ((x % n) == 0)
  </code></pre>
  
  <p>So you could write the following to use this:</p>
  
  <pre><code>val nums = List(1,2,3,4,5,6,7,8)
  println(filter(nums, modN(2))
  </code></pre>
  
  <p>which returns: <code>List(2,4,6,8)</code>.  But I've found that I can do the same thing this way:</p>
  
  <pre><code>def modN(n: Int, x: Int) = ((x % n) == 0)
  
  val p = modN(2, _: Int)
  println(filter(nums, p))
  </code></pre>
  
  <p>which also returns: <code>List(2,4,6,8)</code>. </p>
  
  <p>So my question is, what's the main difference between the two, and when would you use one over the other? Is this just too simplistic of an example to show why one would be used over the other?</p>