title: Julia: Broadcasting Functions with Keyword Arguments
body: <p>Suppose we have a composite type:</p>
  
  <pre><code>mutable struct MyType{TF&lt;:AbstractFloat, TI&lt;:Integer}
  a::TF
  b::TF
  end
  </code></pre>
  
  <p>We define a constructor</p>
  
  <pre><code>function MyType(a; b = 1.0)
      return MyType(a, b)
  end
  </code></pre>
  
  <p>I can broadcast <code>MyType</code> over an array of <code>a</code>'s, but how can I do that for <code>b</code>'s?</p>
  
  <p>I tried to do</p>
  
  <pre><code>MyType.([1.0, 2.0, 3.0]; [:b, 1.0, :b, 2.0, :b, 3.0,]) 
  </code></pre>
  
  <p>But, this does not work.</p>
  
  <p>Note that the above example is totally artificial. In reality, I have a composite type that takes in many fields, many of which are constructed using keyword arguments, and I only want to change a few of them into different values stored in an array.</p>