From 37bfefdc692b39d84607e28e992c21925ebf0117 Mon Sep 17 00:00:00 2001 From: Jack Wines Date: Sun, 4 Feb 2024 04:04:46 -0800 Subject: [PATCH] avoid lines that share the same endpoints, but in reverse order --- src/Triangles.hs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/Triangles.hs b/src/Triangles.hs index cf1ebff..c0ee4e8 100644 --- a/src/Triangles.hs +++ b/src/Triangles.hs @@ -69,11 +69,8 @@ combinations xs = . S.toList . S.fromList . filter (uncurry (/=)) . sortOn (abs . uncurry distanceA) - -- . concat . withStrategy (parListChunk 2000 rdeepseq) $ - $ [(x,y) | x <- xs, y <- xs] - -- . map (\x -> take edgeLengthThreshold . - -- sortOn (abs . uncurry distanceA) - -- . map (\y -> (min x y, max x y)) $ xs) $ xs + . concatMap (\(x:xs) -> map (x,) xs) + . init . tails $ xs where edgeLengthThreshold = 10