title: What is the point of coercions like Int(Cool)?
body: <p><a href="http://doc.perl6.org/language/functions#Coercion_Types" rel="noreferrer">The Perl 6 Web site on functions says</a></p>
  <blockquote>
  <p>Coercion types can help you to have a specific type inside a routine, but accept wider input. When the routine is called, the argument is automatically converted to the narrower type.</p>
  <pre><code>sub double(Int(Cool) $x) {
      2 * $x
  }
  
  say double '21';    # 42
  say double Any;     # Type check failed in binding $x; expected 'Cool' but got 'Any'
  </code></pre>
  <p>Here the Int is the target type to which the argument will be coerced, and Cool is the type that the routine accepts as input.</p>
  </blockquote>
  <p>But what is the point for the sub? Isn't <code>$x</code> just an <code>Int</code>? Why would you restrict the caller to implement <code>Cool</code> for the argument?</p>
  <p>I'm doubly confused by the example because <code>Int</code> already <code>is Cool</code>. So I did an example where the types don't share a hierarchy:</p>
  <pre><code>class Foo { method foomethod { say 'foomethod' } }
  class Bar {}
  
  class Quux is Foo {
  # class Quux { # compile error
    method Bar { Bar.new }
  }
  
  sub foo(Bar(Foo) $c) {
    say $c.WHAT;    # (Bar)
    # $c.foomethod  # fails if uncommented: Method 'foomethod' not found for invocant of class 'Bar'
  }
  
  foo(Quux.new)
  </code></pre>
  <p>Here the invocant of <code>foo</code> is restricted to provide a <code>Foo</code> that can be converted to a <code>Bar</code> but <code>foo</code> cannot even call a method of <code>Foo</code> on <code>$c</code> because its type <em>is</em> <code>Bar</code>. So why would <code>foo</code> care that the to-be-coerced type is a <code>Foo</code> in the first place?</p>
  <p>Could someone shed some light on this? Links to appropriate documentation and parts of the spec are appreciated as well. I couldn't find anything useful there.</p>