Skip to content

Instantly share code, notes, and snippets.

@rgrinberg
Created January 12, 2017 17:25
Show Gist options
  • Save rgrinberg/8bc6906945ef75b1a51e556e099c3f9e to your computer and use it in GitHub Desktop.
Save rgrinberg/8bc6906945ef75b1a51e556e099c3f9e to your computer and use it in GitHub Desktop.
mapM' :: Monad m => (a -> b m) -> [a] -> m [b]
mapM' _ [] = return []
mapM' (x : xs) f = do
y <- f x
ys <- mapM' xs f
return (y : ys)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment