title: Determine fn output type from input type
body: <p>I would like a function that returns f32 if the input is f32, for all other numeric inputs it should return f64.</p>
  <p>A simplified example of the structure is this:</p>
  <pre><code>use num::{Num, NumCast, ToPrimitive, traits::Float};
  
  fn example&lt;N: Num + ToPrimitive, T: Float&gt;(input: N) -&gt; T {
      let output = input + N::one();
      NumCast::from(output).unwrap()
  }
  
  fn main() {
      println!(&quot;{}&quot;, example::&lt;f32, f32&gt;(1f32));
      println!(&quot;{}&quot;, example::&lt;u32, f64&gt;(1u32));
  }
  </code></pre>
  <p>is there a way to control the dispatch so that I can drop the turbofish and it will automatically map</p>
  <p>f32 -&gt; f32 and</p>
  <p>anything else -&gt; f64 ?</p>