Function composition operator doesn't respect default parameters?
<p>I am experimenting with a simple command line app on Linux, and I have the following code.</p>

<p><strong>Code</strong></p>

<pre><code>import Glibc
import Foundation

infix operator |&gt;&gt; { associativity left }
func |&gt;&gt; &lt;A, B, C&gt;(f: A -&gt; B, g: B -&gt; C) -&gt; A -&gt; C {
    return { x in g(f(x)) }
}

func readln(max:Int = 8192) -&gt; String? {
    assert(max &gt; 0, "max must be between 1 and Int.max")
    var buf:Array&lt;CChar&gt; = []
    var c = getchar()
    while c != EOF &amp;&amp; c != 10 &amp;&amp; buf.count &lt; max {
        buf.append(CChar(c))
        c = getchar()
    }
    buf.append(CChar(0))
    return buf.withUnsafeBufferPointer { String.fromCString($0.baseAddress) }
}

func myPrint(str: String?) {
    guard let unwrapped = str else {
        return;
    }
    print("\(unwrapped)")
}

//This compiles &amp; runs
var input = readln()
myPrint(input)

//this does not!
let main = readln |&gt;&gt; myPrint
main()
</code></pre>

<p><strong>Compiler Output</strong></p>

<pre><code>/home/**********/SwiftProjects/HelloPackage/Sources/main.swift:37:5: error: missing argument for parameter #1 in call
main()
    ^
&lt;unknown&gt;:0: error: build had 1 command failures
error: exit(1): ["/home/**********/Swift/usr/bin/swift-build-tool", "-f", "/home/**********/SwiftProjects/HelloPackage/.build/debug/HelloPackage.o/llbuild.yaml"]
</code></pre>

<p>When I use my custom function composition operator, it does not let me use the same default parameter value as when I call the functions separately.</p>

<p>Can anyone explain what is going on?</p>