[Haskell-cafe] Unresolved overloading error

Bryan Burgers bryan.burgers at gmail.com
Sat Mar 31 10:08:44 EDT 2007


On 3/31/07, Scott Brown <doolagarl2002 at yahoo.com.au> wrote:
>
> It's working now, thank you.
> I changed the definition to
>
> > binom n j = div (fac n) ((fac j)*(fac (n - j)))
>
> > bernoulli n p j = fromIntegral(binom n j)*(p ^ j) * ((1 - p)^(n - j))

As a matter of style suggestion, it might make 'binom' more clear if
you use 'div' as an infix operator:

> binom n j = (fac n) `div` ( fac j * fac (n - j) )


More information about the Haskell-Cafe mailing list