title: Why won't vavr's Function1 accepting Seq<Parent> class accept Seq<Child>?
body: <p>I'm using Java with vavr and I have a Function1 that accepts a <code>Seq&lt;Parent&gt;</code> and returns a <code>String</code>. Why won't that class accept <code>Seq&lt;Child&gt;</code>? It seems like something with contravariance/covariance/invariance, but I am having trouble working through why it won't compile. Here is my code:</p>
  <pre><code>interface Bar {
      String getFoo();
  }   
  
  class Foo implements Bar {
      private String foo;
      private String bar;
  
      @Override
      public String getFoo() {
          return foo;
      }
  
      public Foo(String foo, String bar) {
          this.foo = foo;
          this.bar = bar;
      }
  }
  
  
  class Scratch {
      public static void main(String[] args) {
          Function1&lt;Seq&lt;Bar&gt;, String&gt; myFunction = (it) -&gt; &quot;foo&quot;;
          Foo obj = new Foo(&quot;foo&quot;, &quot;bar&quot;);
          Foo obj1 = new Foo(&quot;hello&quot;, &quot;world&quot;);
          Seq&lt;Foo&gt; list = List.of(obj, obj1);
          String result = myFunction.apply(list); // IntelliJ says this line is incorrect
      }
  }
  </code></pre>
  <p>Instead, I get the error (from IntelliJ):</p>
  <pre><code>    apply (io.vavr.collection.Seq&lt;Bar&gt;) in Function1 cannot be applied to (io.vavr.collection.Seq&lt;Foo&gt;).
  </code></pre>
  <p>This simple example seems like it should work just fine. What am I missing and why doesn't it work?</p>