Skip to content

Instantly share code, notes, and snippets.

@theqp
Created December 10, 2020 14:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save theqp/17756e060816c039cd52cb3bb84c4ec0 to your computer and use it in GitHub Desktop.
Save theqp/17756e060816c039cd52cb3bb84c4ec0 to your computer and use it in GitHub Desktop.
flatMapM :: (Monad m, Traversable t) => (a -> m [b]) -> m (t a) -> m [b]
flatMapM f m = m >>= mapM f & fmap concat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment