Lah numbers: Difference between revisions

m
→‎{{header|Haskell}}: Pruning of some minor redundancy
m (→‎{{header|Haskell}}: An applicative pruning of some minor redundancy.)
m (→‎{{header|Haskell}}: Pruning of some minor redundancy)
Line 467:
<lang haskell>import Text.Printf (printf)
import Control.Monad (when)
import Control.Applicative (liftA2)
 
factorial
Line 485 ⟶ 484:
| otherwise = f n `div` f k `div` factorial (n - k)
where
f = (*) . factorial =<<*> (^ 2) . factorial . pred)
 
printLah :: (Word, Word) -> IO ()
9,659

edits