Skip to content

Commit

Permalink
nothing really critical, cleaned up the code a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
PiotrJustyna committed Mar 5, 2024
1 parent edab6de commit f239385
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions HelloWorld.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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 [] = []

Expand Down

0 comments on commit f239385

Please sign in to comment.