On 7/20/2014 8:15 PM, Timon Gehr wrote:
So does Haskell.import Control.Monad import Control.Monad.ST import Data.STRef factorial :: Integer -> Integer factorial n = runST $ do r <- newSTRef 1 forM_ [1..n] $ \i-> modifySTRef r (*i) readSTRef r
Would you rather write that or: int factorial(int i) pure { auto r = 1; foreach (i; 1..n + 1) r *= i; return r; } And I'd love to see what native code is generated for the Haskell example.