    , isPerfectSquare csqr
    , let c = floorSqrt csqr ]

-- | Generate ordered Pythagorean Triples lexiconically ordered
pythagTriplesOrdered2 :: [Triple]
pythagTriplesOrdered2 = [ (a, b, c) |
      b <- [4 .. ]
    , a <- [(floorSqrt $ 2*b + 1) .. b - 1]
    , gcd b a == 1
    , let csqr = a*a + b*b
    , isPerfectSquare csqr
    , let c = floorSqrt csqr ]

-- Utility functions
