title: Swift - how to create custom operators to use in other modules?
body: <p>I created a sample project and a framework next to it. The framework is called "SampleFramework". Then I created a custom operator in SampleFramework. Here is what it looks like:</p>
  
  <pre><code>infix operator &gt;&gt;= {associativity left}
  public func &gt;&gt;=&lt;A, B&gt;(a: A?, f: A -&gt; B?) -&gt; B? {
      if let a = a { return f(a) }
      else { return .None }
  }
  </code></pre>
  
  <p>Then I wanted to use it my main application. I imported the <code>SampleFramework</code> to my source file and then I wrote this code to test it:</p>
  
  <pre><code>NSURL(string: "www.google.com") &gt;&gt;= { println("\($0)") }
  </code></pre>
  
  <p>It didn't compile. Here is Xcode's error message:</p>
  
  <blockquote>
    <p>Ambiguous operator declarations found for operator. Operator is not a
    known binary operator</p>
  </blockquote>