Created
February 26, 2015 09:40
-
-
Save JustinSDK/3b82f8c605fb1c5c8389 to your computer and use it in GitHub Desktop.
〈Haskell Tutorial(31)do 區塊與 <- 綁定〉的習題解答
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sequence' :: Monad m => [m a] -> m [a] | |
sequence' [] = return [] | |
sequence' (x:xs) = do | |
value <- x | |
values <- sequence' xs | |
return (value : values) | |
forM' :: Monad m => [a] -> (a -> m b) -> m [b] | |
forM' xs f = sequence' $ map f xs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment