Created
January 26, 2020 17:34
-
-
Save djspiewak/63abc62712a3089ecf14d9f452bb2255 to your computer and use it in GitHub Desktop.
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
def foldDistributesOverSequence[A: Monoid](fga: F[G[A]]) = { | |
implicit val mga: Monoid[G[A]] = Applicative.monoid[G, A] | |
fga.fold <-> fga.sequence.map(_.fold) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment