diff options
Diffstat (limited to 'shelf.hs')
-rwxr-xr-x | shelf.hs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/shelf.hs b/shelf.hs new file mode 100755 index 0000000..2c27b52 --- /dev/null +++ b/shelf.hs | |||
@@ -0,0 +1,28 @@ | |||
1 | #!/usr/bin/env stack | ||
2 | {- stack script --resolver lts-16.14 --install-ghc | ||
3 | --ghc-options -Wall --ghc-options -Wno-unused-imports -} | ||
4 | {-# language NoImplicitPrelude #-} | ||
5 | {-# language DuplicateRecordFields #-} | ||
6 | import Rebase.Prelude | ||
7 | import Control.Lens | ||
8 | |||
9 | type Inches = Rational | ||
10 | |||
11 | boardLength, boardThickness, kickerHeight, numShelves, numHorizontals, availableSpace :: Inches | ||
12 | boardLength = 6 * 12 | ||
13 | boardThickness = 5/8 | ||
14 | kickerHeight = 4 | ||
15 | numShelves = 5 | ||
16 | |||
17 | numHorizontals = numShelves + 1 | ||
18 | availableSpace = boardLength - kickerHeight - numHorizontals * boardThickness | ||
19 | |||
20 | shelves :: [Rational] | ||
21 | shelves = [2%9, 2%9, 2%9, 1%6, 1%6] | ||
22 | |||
23 | |||
24 | main :: IO () | ||
25 | main = do | ||
26 | _ <- return $ assert $ sum shelves == 1 | ||
27 | print shelves | ||
28 | return () | ||