2006-10-19から1日間の記事一覧

実録これがモナドだ

@ghci Prelude> :m Monad Prelude Monad> (*3) $ (+5) $ 10 45 Prelude Monad> liftM (*3) $ liftM (+5) $ return 10 :: Maybe Int Just 45 Prelude Monad> liftM (*3) $ liftM (+5) $ Nothing :: Maybe Int Nothingf $ g $ h は f (g (h))だよ liftM f x は…