Skip to content

Instantly share code, notes, and snippets.

@theqp
Last active February 13, 2021 04:03
Show Gist options
  • Save theqp/d521b18725fd7cb4a6f3f17d494f27e7 to your computer and use it in GitHub Desktop.
Save theqp/d521b18725fd7cb4a6f3f17d494f27e7 to your computer and use it in GitHub Desktop.
sumOfSquares = (+) `on` square
sumOfLargestTwoSquared x y z =
uncurry
sumOfSquares
$ if x > y
then (x, max y z)
else (y, max x z)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment