Created
July 13, 2017 06:32
-
-
Save anonymous/5e297a353cd5785802c2fcc8caa0afee to your computer and use it in GitHub Desktop.
the description for this gist
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
class AllTheMathPrograms[F[_]](implicit A: AllTheMath[F]) { | |
import A._ | |
type FS[A] = FreeS[F, A] | |
def `(a+b)^2`(a: Int, b: Int): FS[Int] = | |
for { | |
sum <- basic.add(a, b) | |
square <- high.power(sum, 2) | |
} yield square | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment