title: In Swift 3, what is a way to compare two closures?
body: <p>Suppose you have two closures of type <code>(Int)-&gt;()</code> in Swift 3 and test to see if they are the same as each other:</p>
  
  <pre><code>typealias Baz = (Int)-&gt;()
  let closure1:Baz = { print("foo \($0)") }
  let closure2:Baz = { print("bar \($0)") }
  
  if(closure1 == closure2) {
      print("equal")
  }
  </code></pre>
  
  <p>This fails to compile, giving the message:</p>
  
  <blockquote>
    <p>Binary operator '==' cannot be applied to two '(Int)->()' operands</p>
  </blockquote>
  
  <p>OK, well, how then can we compare two closures of the same type, to see if they are the same? </p>