I have no idea if the following is faster or not (I suspect not), but
it is certainly easier to read:

n `choose` k = (n `permute` k) `div` (fact k)
n `permute` k = product [(n-k+1) .. n]
fact n = product [1 .. n]

mike

-- 
mike castleman / [EMAIL PROTECTED] / http://mlcastle.net
aolim: mlcastle / icq: 3520821 / yahoo: mlc000
"we have invented the technology to eliminate scarcity, but we are 
deliberately throwing it away to be benefit those who profit from 
scarcity....I think we should embrace the era of plenty, and work out   
how to mutually live in it." -- john gilmore
_______________________________________________
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to