Skip to content

Instantly share code, notes, and snippets.

Created July 13, 2017 06:32
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 anonymous/5e297a353cd5785802c2fcc8caa0afee to your computer and use it in GitHub Desktop.
Save anonymous/5e297a353cd5785802c2fcc8caa0afee to your computer and use it in GitHub Desktop.
the description for this gist
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