title: 'Where' function type in Haskell
body: <p>For example, i've got following function:</p>
  
  <pre><code>foo :: t -&gt; f
  foo var = foo' b var
      where
          b = bar 0.5 vect
  </code></pre>
  
  <p>and I need to specify literals' 0.5 type — 't'</p>
  
  <p>If i write smth. like <code>(0.5::t)</code>, GHC creates new type variable 't0', which is not corresponding to original 't'.</p>
  
  <p>I've wrote a small function</p>
  
  <pre><code>ct :: v -&gt; v -&gt; v
  ct _ u = u
  </code></pre>
  
  <p>and use it like this:</p>
  
  <pre><code>b = bar (ct var 0.5) d
  </code></pre>
  
  <p>Is there any better solution?</p>