RosettaCodeData/Task/List-comprehensions/OCaml/list-comprehensions-2.ml
2024-10-16 18:07:41 -07:00

6 lines
133 B
Standard ML

let pyth n =
let* x = 1 -- n in
let* y = x -- n in
let* z = y -- n in
if x * x + y * y <> z * z then [] else
[x, y, z]