+ "&") Just "yotsuba&" > Nothing `applyMaybe` \x -> Just (x ++ "&") Nothing ! > Just "yotsuba" `applyMaybe` \x -> if x == "yanda" then Nothing else Just (x ++ "&") Just "yotsuba&" > Just "yanda" `applyMaybe` \x -> if x == "yanda" then Nothing else Just (x ++ "&") Nothing
>> Just 4 Just 4 > Just 3 >> Nothing Nothing ! # bananaのかわりに使う > return (0, 0) >>= landLeft 1 >> Nothing >>= landRight 1 Nothing (>>) :: (Monad m) => m a -> m b -> m b m >> n = m >>= \_ -> n
(0, 0) of Nothing -> Nothing Just pole1 -> case landRight 4 pole1 of Nothing -> Nothing Just pole2 -> case landLeft 2 pole2 of Nothing -> Nothing Just pole3 -> landLeft 1 pole3