title: Define a first-order function that combines other first-order functions
body: <p>I have this class <code>MyClass</code>:</p>
  
  <pre><code>abstract class MyClass { def myMethod: A =&gt; B }
  
  object MyClass { 
    def apply(dep: A =&gt; B)(f: B =&gt; B) = new MyClass{ def myMethod = ????? }
  }
  </code></pre>
  
  <p>Inside the <code>apply</code> method , I'd like to define <code>myMethod</code> that combines <code>f</code> and <code>dep</code> functions like <code>f(dep)</code>. How can I do that?</p>