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/e2a531cebf80c6229caa8fae3f1ca0a4 to your computer and use it in GitHub Desktop.
Save anonymous/e2a531cebf80c6229caa8fae3f1ca0a4 to your computer and use it in GitHub Desktop.
the description for this gist
@module trait AllTheMath {
val basic: BasicMath
val high: HighMath
def squareOfSum(a: Int, b: 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