2012-09-30から1日間の記事一覧
すごいHaskell P.340 に State モナドを使って乱数の生成をきれいに書く例が載っている。 import System.Random import Control.Monad.State randomSt :: (RandomGen g, Random a) => State g a randomSt = state random threeConins :: State StdGen (Bool,…
すごいHaskell P.340 に State モナドを使って乱数の生成をきれいに書く例が載っている。 import System.Random import Control.Monad.State randomSt :: (RandomGen g, Random a) => State g a randomSt = state random threeConins :: State StdGen (Bool,…