<div>Hello,</div>
<div>&nbsp;</div>
<div>I&#39;m new to Haskell and it seems like a very nice language to learn. However I&#39;m not really familiar with the errormessages it produces. I am using a Helium interpreter. I&#39;ve created the following module (however it is just a small sketch). I&#39;ve written the following code:</div>

<div>&nbsp;</div>
<div>fac :: Int -&gt; Int<br>fac n = product[1..n]</div>
<div>&nbsp;</div>
<div>boven :: Int -&gt; Int -&gt; Int<br>boven n k = (fac n) `div` fac k * fac (n-k)</div>
<div>&nbsp;</div>
<div>bin :: Int -&gt; Int -&gt; Int -&gt; Int<br>bin n k p&nbsp;&nbsp; |(n-k)&gt;0 &amp;&amp; k&gt;0 = (boven n k) * (p^k) * (1-p)^(n-k)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |(n-k)&lt;0 &amp;&amp; k&gt;0 = (boven n k) * (p^k) * (1/((1-p)^(-(n-k))))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |(n-k)&lt;0 &amp;&amp; k&lt;0 = (boven n k) * (1/(p^(-k))) * (1/((1-p)^(-(n-k))))</div>
<div>&nbsp;</div>
<div>When I load this into my interpreter it says:</div>
<div>&nbsp;</div>
<div>Compiling ./Test.hs<br>(11,55): Type error in infix application<br>&nbsp;expression&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : 1 / ((1 - p) ^ (-(n - k)))<br>&nbsp;operator&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : /<br>&nbsp;&nbsp; type&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : Float -&gt; Float -&gt; Float<br>&nbsp;&nbsp; does not match : Int&nbsp;&nbsp; -&gt; Int&nbsp;&nbsp; -&gt; Int&nbsp; </div>

<div>(12,47): Type error in infix application<br>&nbsp;expression&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : 1 / (p ^ (-k))<br>&nbsp;operator&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : /<br>&nbsp;&nbsp; type&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : Float -&gt; Float -&gt; Float<br>&nbsp;&nbsp; does not match : Int&nbsp;&nbsp; -&gt; Int&nbsp;&nbsp; -&gt; a&nbsp;&nbsp;&nbsp; </div>

<div>(12,62): Type error in infix application<br>&nbsp;expression&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : 1 / ((1 - p) ^ (-(n - k)))<br>&nbsp;operator&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : /<br>&nbsp;&nbsp; type&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : Float -&gt; Float -&gt; Float<br>&nbsp;&nbsp; does not match : Int&nbsp;&nbsp; -&gt; Int&nbsp;&nbsp; -&gt; a&nbsp;&nbsp;&nbsp; </div>

<div>Compilation failed with 3 errors</div>
<div>&nbsp;</div>
<div>Some details that might be usefull:</div>
<div>&nbsp;</div>
<div>Line 11 is |(n-k)&lt;0 &amp;&amp; k&gt;0 = (boven n k) * (p^k) * (1/((1-p)^(-(n-k))))</div>
<div>Line 12 is |(n-k)&lt;0 &amp;&amp; k&lt;0 = (boven n k) * (1/(p^(-k))) * (1/((1-p)^(-(n-k))))</div>
<div>&nbsp;</div>
<div>So my question is: how can I fix these errors?</div>
<div>&nbsp;</div>
<div>(I used these lines of codes because it is not possible to use a negative exponent in the Helium interpreter.)</div>
<div>&nbsp;</div>
<div>Thank you for answering my question!</div>
<div>&nbsp;</div>
<div>Greetings JTKM</div>