title: How to compose curried functions in Scala
body: <p>Is it possible compose functions in Scala that are curried? For example:</p>
  
  <pre><code>def a(s1: String)(s2: String): Int = s1.length + s2.length
  def b(n: Int): Boolean = n % 2 == 0
  
  def x : String =&gt; String =&gt; Boolean = a andThen b
  
  x("blabla")("foo") 
  </code></pre>
  
  <p>Edit : </p>
  
  <p>I've found a way of doing it in Haskell :</p>
  
  <pre><code>a :: String -&gt; String -&gt; Int
  a s1 s2 = length s1 + length s2
  
  b :: Int -&gt; Bool
  b n = mod n 2 == 0
  
  c :: String -&gt; String -&gt; Bool 
  c = curry (b . (uncurry a))
  </code></pre>