From f239385706841414569f8186e390247eae3f0d87 Mon Sep 17 00:00:00 2001 From: Piotr Justyna Date: Tue, 5 Mar 2024 11:20:43 +0000 Subject: [PATCH] nothing really critical, cleaned up the code a bit --- HelloWorld.hs | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/HelloWorld.hs b/HelloWorld.hs index 313826e..00d210f 100644 --- a/HelloWorld.hs +++ b/HelloWorld.hs @@ -13,21 +13,16 @@ stepName :: Step -> Double stepName Step { originCoordinates = x, name = y } = y stepShape :: Double -> Diagram B -stepShape x = rect 0.75 0.5 - # showOrigin - # named x +stepShape x = rect 0.75 0.5 # showOrigin # named x + +uniqueName :: Double -> Double -> Double +uniqueName x y = x * 10 + y steps :: [Step] -steps = [ - Step { - originCoordinates = p2 (x, y), - name = x * 10 + y } - | x <- [0], - y <- [0, -1, -2, -3]] +steps = [ Step { originCoordinates = p2 (x, y), name = uniqueName x y } | x <- [0], y <- [0, -1, -2, -3]] connections :: [Step] -> [QDiagram B V2 Double Any -> QDiagram B V2 Double Any] -connections (x1: x2: xn) = - connectOutside (stepName x1) (stepName x2): connections (x2: xn) +connections (x1: x2: xn) = connectOutside (stepName x1) (stepName x2): connections (x2: xn) connections (x1: []) = [] connections [] = []