Created
November 16, 2012 15:18
-
-
Save naohaq/4088125 to your computer and use it in GitHub Desktop.
Re-implementation of 'sequence'
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
mysequence :: (Monad m) => [m a] -> m [a] | |
mysequence xs = loop xs [] | |
where loop [] ys = return $ reverse ys | |
loop (x:xs) ys = x >>= \y -> loop xs (y:ys) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment