title: Partial function application in Kotlin
body: <p>I am having trouble with syntax for partial function application.  The following code works fine, and it outputs: <code>two-three-four</code></p>
  
  <pre><code>import kotlin.coroutines.experimental.*
  
  inline fun &lt;T&gt; Iterable&lt;T&gt;.forEachFrom(beg:Int, act:(T)-&gt;Unit) {
    var i=0;  if (beg&gt;=0) for (e in this) if (i++ &gt;= beg) act(e)
  }    // sample function I am testing; please don't change this!
  
  fun main(a:Array&lt;String&gt;) {
    val l = listOf("zero", "one", "two", "three", "four")
    fun test() = buildSequence { l.forEachFrom(2) { yield(it) } }.joinToString("-")
    println(test())
  }
  </code></pre>
  
  <p>I'd like to encapsulate my <code>test()</code>, so it is called as:
  <code>test(l.forEachFrom(2))</code>  However, I can't seem to get the types/syntax right. 
   <strong>How would I re-write the <code>test()</code> function definition to make this possible?</strong></p>