title: new() method on traits with varying parameters
body: <p>I'm trying to make a trait with various implementations with different internal parameters:</p>
  
  <pre><code>pub trait ERP {
      fn new() -&gt; Self;
      fn sample(&amp;self) -&gt; f64;
  }
  
  pub struct Bernoulli {
      p: f64
  }
  
  impl ERP for Bernoulli {
      fun new(p: f64) -&gt; Bernoulli {
          Bernoulli { p: p }
      }
  
      fun sample(&amp;self) -&gt; f64 { self.p } // Filler code
  }
  
  pub struct Gaussian {
      mu: f64,
      sigma: f64
  }
  
  impl ERP for Gaussian {
      fun new(mu: f64, sigma: f64) -&gt; Gaussian {
          Gaussian { mu: mu, sigma: sigma }
      }
  
      fun sample(&amp;self) -&gt; f64 { self.mu } // Filler code
  }
  </code></pre>
  
  <p>But of course I get</p>
  
  <pre><code>error: method new` has 1 parameter but the declaration in trait
  `erp::ERP::new` has 0
  </code></pre>
  
  <p>since I must specify a fixed number of arguments in the trait.</p>
  
  <p>I also can't leave <code>new</code> out of the trait, since that gives</p>
  
  <pre><code>error: method `new` is not a member of trait `ERP`
  </code></pre>
  
  <p>My motivation is that I want the exposed ERP interface to stay consistent <em>except</em> for the <code>new</code> method, since each distribution's required parameters are dependent on the unique mathematics behind its implementation. Are there any workarounds?</p>