title: Javascript Flow generic functions syntax
body: <p>I'm facing some syntax errors when trying to write generic map function.</p>
  
  <pre><code>function mymap&lt;A, B&gt;(fun: (_: A) =&gt; B, array: Array&lt;A&gt;): Array&lt;B&gt; {
      let result: Array&lt;B&gt; = [];
      for (let i of array)
          result.push(fun(i));
      return result;
  }
  
  let x = mymap&lt;number, number&gt;(x =&gt; x, [1, 2, 3]);
                              ^ Unexpected token    
  </code></pre>
  
  <p>Flow says: <code>Unexpected token &gt;</code>. What am I doing wrong? Thank you for your help.</p>