title: How to get Implicit parameter into an anonymous function
body: <p>How do I get the implicit val myConnection into scope of the execute(true) function</p>
  
  <pre><code>def execute[T](active: Boolean)(blockOfCode: =&gt; T): Either[Exception, T] = {
    implicit val myConnection = "how to get this implicit val into scope"
    Right(blockOfCode)
  }
  
  
  
  execute(true){
  // myConnection is not in scope
    useMyConnection()   // &lt;- needs implicit value
  }
  </code></pre>