Using the / operation, you ask haskell to use a fractional data type. You probably don't want this. It is preferable to use an integral type such as Int or Integer . Therefore, I suggest doing the following: 1. Add a type declaration for the fact function, something like fact :: Integer -> Integer 2. Use quot instead of / .
So your code should look like this:
fact :: Integer -> Integer fact 0 = 1 fact x = x * fact (x-1) place :: Integer -> Integer -> Integer place mn = (fact m) `quot` (fact n) * (fact (mn)) main = do print (place 0 0)
Also, as @leftaroundabout pointed out , you probably want to use a better algorithm to calculate these binomial numbers.
source share