Skip to content

Instantly share code, notes, and snippets.

@izanbf1803
Created September 1, 2017 01:32
Show Gist options
  • Save izanbf1803/82ef9008a8d526bf0a6d077724addf10 to your computer and use it in GitHub Desktop.
Save izanbf1803/82ef9008a8d526bf0a6d077724addf10 to your computer and use it in GitHub Desktop.
Haskell comprehension list implementing Pythagorean triples calculation.
pyTriples :: Integer -> [(Integer, Integer, Integer)]
pyTriples n = [(a, b, c) | a <- [1..n], b <- [1..n], c <- [1..n], a^2 + b^2 == c^2]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment