From 43c782078dcdc4efdfe8f6bb0d155d85d82c13c3 Mon Sep 17 00:00:00 2001 From: Maxime Vorwerk Date: Fri, 12 Apr 2024 16:55:50 +0200 Subject: [PATCH] Please enter the commit message for your changes. Lines starting --- haskell-old/CHANGELOG.md | 11 --- haskell-old/LICENSE | 30 ------- haskell-old/README.md | 1 - haskell-old/Setup.hs | 2 - haskell-old/app/Main.hs | 73 ------------------ haskell-old/package.yaml | 65 ---------------- haskell-old/pcc-haskell.cabal | 72 ----------------- haskell-old/stack.yaml | 67 ---------------- haskell-old/test/Spec.hs | 3 - haskell/.gitignore | 2 - .../dist/x86_64-linux/ghc-9.6.4/build-lock | 0 .../ghc-9.6.4/build/Paths_pcc_haskell.dyn_hi | Bin .../ghc-9.6.4/build/Paths_pcc_haskell.dyn_o | Bin .../ghc-9.6.4/build/Paths_pcc_haskell.hi | Bin .../ghc-9.6.4/build/Paths_pcc_haskell.o | Bin .../ghc-9.6.4/build/PolyCube.dyn_hi | Bin .../ghc-9.6.4/build/PolyCube.dyn_o | Bin .../x86_64-linux/ghc-9.6.4/build/PolyCube.hi | Bin .../x86_64-linux/ghc-9.6.4/build/PolyCube.o | Bin .../build/autogen/PackageInfo_pcc_haskell.hs | 0 .../build/autogen/Paths_pcc_haskell.hs | 0 .../ghc-9.6.4/build/autogen/cabal_macros.h | 0 ...0.1.0.0-6K1H0wLq681LrfvIdKcNTn-ghc9.6.4.so | Bin ...c-haskell-0.1.0.0-6K1H0wLq681LrfvIdKcNTn.a | Bin .../autogen/PackageInfo_pcc_haskell.hs | 0 .../autogen/Paths_pcc_haskell.hs | 0 .../pcc-haskell-exe/autogen/cabal_macros.h | 0 .../build/pcc-haskell-exe/pcc-haskell-exe | Bin .../pcc-haskell-exe-tmp/Main.hi | Bin .../pcc-haskell-exe-tmp/Main.o | Bin .../pcc-haskell-exe-tmp/Paths_pcc_haskell.hi | Bin .../pcc-haskell-exe-tmp/Paths_pcc_haskell.o | Bin .../package.conf.inplace/package.cache.lock | 0 ...askell-0.1.0.0-6K1H0wLq681LrfvIdKcNTn.conf | 0 .../dist/x86_64-linux/ghc-9.6.4/setup-config | Bin .../exe-pcc-haskell-exe | 0 .../lib | 0 .../x86_64-linux/ghc-9.6.4/stack-cabal-mod | 0 .../x86_64-linux/ghc-9.6.4/stack-project-root | 0 .../ghc-9.6.4/stack-setup-config-mod | 0 .../9.6.4/doc/pcc-haskell-0.1.0.0/LICENSE | 0 ...0.1.0.0-6K1H0wLq681LrfvIdKcNTn-ghc9.6.4.so | Bin .../Paths_pcc_haskell.dyn_hi | Bin .../Paths_pcc_haskell.hi | Bin .../PolyCube.dyn_hi | Bin .../PolyCube.hi | Bin ...c-haskell-0.1.0.0-6K1H0wLq681LrfvIdKcNTn.a | Bin .../9.6.4/pkgdb/package.cache.lock | 0 ...askell-0.1.0.0-6K1H0wLq681LrfvIdKcNTn.conf | 0 .../.stack-work/stack.sqlite3 | Bin .../stack.sqlite3.pantry-write-lock | 0 haskell/app/Main.hs | 71 ++++++++++++++++- {haskell-old => haskell}/count.out | 0 haskell/package.yaml | 6 ++ haskell/pcc-haskell.cabal | 7 +- haskell/src/Lib.hs | 6 -- {haskell-old => haskell}/src/PolyCube.hs | 0 haskell/stack.yaml | 10 +-- {haskell-old => haskell}/stack.yaml.lock | 0 haskell/test/Spec.hs | 1 + 60 files changed, 87 insertions(+), 340 deletions(-) delete mode 100644 haskell-old/CHANGELOG.md delete mode 100644 haskell-old/LICENSE delete mode 100644 haskell-old/README.md delete mode 100644 haskell-old/Setup.hs delete mode 100644 haskell-old/app/Main.hs delete mode 100644 haskell-old/package.yaml delete mode 100644 haskell-old/pcc-haskell.cabal delete mode 100644 haskell-old/stack.yaml delete mode 100644 haskell-old/test/Spec.hs delete mode 100644 haskell/.gitignore rename {haskell-old => haskell}/.stack-work/dist/x86_64-linux/ghc-9.6.4/build-lock (100%) rename {haskell-old => haskell}/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/Paths_pcc_haskell.dyn_hi (100%) rename {haskell-old => haskell}/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/Paths_pcc_haskell.dyn_o (100%) rename {haskell-old => haskell}/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/Paths_pcc_haskell.hi (100%) rename {haskell-old => haskell}/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/Paths_pcc_haskell.o (100%) rename {haskell-old => haskell}/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/PolyCube.dyn_hi (100%) rename {haskell-old => haskell}/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/PolyCube.dyn_o (100%) rename {haskell-old => haskell}/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/PolyCube.hi (100%) rename {haskell-old => haskell}/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/PolyCube.o (100%) rename {haskell-old => haskell}/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/autogen/PackageInfo_pcc_haskell.hs (100%) rename {haskell-old => haskell}/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/autogen/Paths_pcc_haskell.hs (100%) rename {haskell-old => haskell}/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/autogen/cabal_macros.h (100%) rename {haskell-old => haskell}/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/libHSpcc-haskell-0.1.0.0-6K1H0wLq681LrfvIdKcNTn-ghc9.6.4.so (100%) rename {haskell-old => haskell}/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/libHSpcc-haskell-0.1.0.0-6K1H0wLq681LrfvIdKcNTn.a (100%) rename {haskell-old => haskell}/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/pcc-haskell-exe/autogen/PackageInfo_pcc_haskell.hs (100%) rename {haskell-old => haskell}/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/pcc-haskell-exe/autogen/Paths_pcc_haskell.hs (100%) rename {haskell-old => haskell}/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/pcc-haskell-exe/autogen/cabal_macros.h (100%) rename {haskell-old => haskell}/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/pcc-haskell-exe/pcc-haskell-exe (100%) rename {haskell-old => haskell}/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/pcc-haskell-exe/pcc-haskell-exe-tmp/Main.hi (100%) rename {haskell-old => haskell}/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/pcc-haskell-exe/pcc-haskell-exe-tmp/Main.o (100%) rename {haskell-old => haskell}/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/pcc-haskell-exe/pcc-haskell-exe-tmp/Paths_pcc_haskell.hi (100%) rename {haskell-old => haskell}/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/pcc-haskell-exe/pcc-haskell-exe-tmp/Paths_pcc_haskell.o (100%) rename {haskell-old => haskell}/.stack-work/dist/x86_64-linux/ghc-9.6.4/package.conf.inplace/package.cache.lock (100%) rename {haskell-old => haskell}/.stack-work/dist/x86_64-linux/ghc-9.6.4/package.conf.inplace/pcc-haskell-0.1.0.0-6K1H0wLq681LrfvIdKcNTn.conf (100%) rename {haskell-old => haskell}/.stack-work/dist/x86_64-linux/ghc-9.6.4/setup-config (100%) rename {haskell-old => haskell}/.stack-work/dist/x86_64-linux/ghc-9.6.4/stack-build-caches/75fd8e4951838cd19ff034f1d6b677ab2be4fb856638520103bae2e94ff9d516/exe-pcc-haskell-exe (100%) rename {haskell-old => haskell}/.stack-work/dist/x86_64-linux/ghc-9.6.4/stack-build-caches/75fd8e4951838cd19ff034f1d6b677ab2be4fb856638520103bae2e94ff9d516/lib (100%) rename {haskell-old => haskell}/.stack-work/dist/x86_64-linux/ghc-9.6.4/stack-cabal-mod (100%) rename {haskell-old => haskell}/.stack-work/dist/x86_64-linux/ghc-9.6.4/stack-project-root (100%) rename {haskell-old => haskell}/.stack-work/dist/x86_64-linux/ghc-9.6.4/stack-setup-config-mod (100%) rename {haskell-old => haskell}/.stack-work/install/x86_64-linux/75fd8e4951838cd19ff034f1d6b677ab2be4fb856638520103bae2e94ff9d516/9.6.4/doc/pcc-haskell-0.1.0.0/LICENSE (100%) rename {haskell-old => haskell}/.stack-work/install/x86_64-linux/75fd8e4951838cd19ff034f1d6b677ab2be4fb856638520103bae2e94ff9d516/9.6.4/lib/x86_64-linux-ghc-9.6.4/libHSpcc-haskell-0.1.0.0-6K1H0wLq681LrfvIdKcNTn-ghc9.6.4.so (100%) rename {haskell-old => haskell}/.stack-work/install/x86_64-linux/75fd8e4951838cd19ff034f1d6b677ab2be4fb856638520103bae2e94ff9d516/9.6.4/lib/x86_64-linux-ghc-9.6.4/pcc-haskell-0.1.0.0-6K1H0wLq681LrfvIdKcNTn/Paths_pcc_haskell.dyn_hi (100%) rename {haskell-old => haskell}/.stack-work/install/x86_64-linux/75fd8e4951838cd19ff034f1d6b677ab2be4fb856638520103bae2e94ff9d516/9.6.4/lib/x86_64-linux-ghc-9.6.4/pcc-haskell-0.1.0.0-6K1H0wLq681LrfvIdKcNTn/Paths_pcc_haskell.hi (100%) rename {haskell-old => haskell}/.stack-work/install/x86_64-linux/75fd8e4951838cd19ff034f1d6b677ab2be4fb856638520103bae2e94ff9d516/9.6.4/lib/x86_64-linux-ghc-9.6.4/pcc-haskell-0.1.0.0-6K1H0wLq681LrfvIdKcNTn/PolyCube.dyn_hi (100%) rename {haskell-old => haskell}/.stack-work/install/x86_64-linux/75fd8e4951838cd19ff034f1d6b677ab2be4fb856638520103bae2e94ff9d516/9.6.4/lib/x86_64-linux-ghc-9.6.4/pcc-haskell-0.1.0.0-6K1H0wLq681LrfvIdKcNTn/PolyCube.hi (100%) rename {haskell-old => haskell}/.stack-work/install/x86_64-linux/75fd8e4951838cd19ff034f1d6b677ab2be4fb856638520103bae2e94ff9d516/9.6.4/lib/x86_64-linux-ghc-9.6.4/pcc-haskell-0.1.0.0-6K1H0wLq681LrfvIdKcNTn/libHSpcc-haskell-0.1.0.0-6K1H0wLq681LrfvIdKcNTn.a (100%) rename {haskell-old => haskell}/.stack-work/install/x86_64-linux/75fd8e4951838cd19ff034f1d6b677ab2be4fb856638520103bae2e94ff9d516/9.6.4/pkgdb/package.cache.lock (100%) rename {haskell-old => haskell}/.stack-work/install/x86_64-linux/75fd8e4951838cd19ff034f1d6b677ab2be4fb856638520103bae2e94ff9d516/9.6.4/pkgdb/pcc-haskell-0.1.0.0-6K1H0wLq681LrfvIdKcNTn.conf (100%) rename {haskell-old => haskell}/.stack-work/stack.sqlite3 (100%) rename {haskell-old => haskell}/.stack-work/stack.sqlite3.pantry-write-lock (100%) rename {haskell-old => haskell}/count.out (100%) delete mode 100644 haskell/src/Lib.hs rename {haskell-old => haskell}/src/PolyCube.hs (100%) rename {haskell-old => haskell}/stack.yaml.lock (100%) diff --git a/haskell-old/CHANGELOG.md b/haskell-old/CHANGELOG.md deleted file mode 100644 index fce9b9f..0000000 --- a/haskell-old/CHANGELOG.md +++ /dev/null @@ -1,11 +0,0 @@ -# Changelog for `pcc-haskell` - -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), -and this project adheres to the -[Haskell Package Versioning Policy](https://pvp.haskell.org/). - -## Unreleased - -## 0.1.0.0 - YYYY-MM-DD diff --git a/haskell-old/LICENSE b/haskell-old/LICENSE deleted file mode 100644 index 98e2291..0000000 --- a/haskell-old/LICENSE +++ /dev/null @@ -1,30 +0,0 @@ -Copyright Author name here (c) 2024 - -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - - * Neither the name of Author name here nor the names of other - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/haskell-old/README.md b/haskell-old/README.md deleted file mode 100644 index 302ec3a..0000000 --- a/haskell-old/README.md +++ /dev/null @@ -1 +0,0 @@ -# pcc-haskell diff --git a/haskell-old/Setup.hs b/haskell-old/Setup.hs deleted file mode 100644 index 9a994af..0000000 --- a/haskell-old/Setup.hs +++ /dev/null @@ -1,2 +0,0 @@ -import Distribution.Simple -main = defaultMain diff --git a/haskell-old/app/Main.hs b/haskell-old/app/Main.hs deleted file mode 100644 index 263da10..0000000 --- a/haskell-old/app/Main.hs +++ /dev/null @@ -1,73 +0,0 @@ -module Main (main) where - -import PolyCube -import Text.Read (readMaybe) -import System.Exit ( ExitCode(ExitFailure), exitWith ) -import System.Environment (getArgs) -import qualified Data.HashMap.Strict as Map -import Combinatorics - -main :: IO () -main = do - maxSize <- parseCLIArgs - let cube = PolyCube (map (const [Coord3D (0, 0, 0)]) ([1..24]::[Int])) [Coord3D (0, 0, 0)] 1 - let polycubes = Map.singleton (getOffsets $ head $ orientations cube) (size cube, head $ orientations cube) - let result = evaluateChildren maxSize cube polycubes - let counts = foldr (increment . fst) [] result - writeFile "count.out" $ show counts - return () - -increment :: Int -> [Int] -> [Int] -increment 1 [] = [1] -increment n [] = 0:increment (n-1) [] -increment 1 (x:xs) = (x+1):xs -increment n (x:xs) = x:increment (n-1) xs - -parseCLIArgs :: IO Int -parseCLIArgs = do - args <- getArgs - let maxSize = readMaybe $ head args :: Maybe Int - maybe (exitWith $ ExitFailure 1) return maxSize - -evaluateChildren :: Int -> PolyCube -> Map.HashMap [Offset3D] (Int, [Coord3D]) -> Map.HashMap [Offset3D] (Int, [Coord3D]) -evaluateChildren maxSize polycube = loop (getChildren (maxSize - size polycube) polycube) where - loop :: [PolyCube] -> Map.HashMap [Offset3D] (Int, [Coord3D]) -> Map.HashMap [Offset3D] (Int, [Coord3D]) - loop [] d = d - loop ((PolyCube o la s):pcs) d = if any (flip Map.member d . getOffsets) o - then loop pcs d - else loop pcs $ evaluateChildren maxSize (PolyCube o la s) $ Map.insert (getOffsets $ head o) (s, head o) d - -getChildren :: Int -> PolyCube -> [PolyCube] -getChildren 0 _ = [] -getChildren i (PolyCube o la s) = foldr condGrowth [] $ foldr (\x acc -> tuples x possibleGrowth ++ acc) [] [1..i] where - condGrowth :: [Coord3D] -> [PolyCube] -> [PolyCube] - condGrowth gs ps = if any (\x -> elem x $ head o) gs - then ps - else PolyCube (zipWith (\x n -> insertAllSorted x $ rotateCubes gs n) o [1..24]) gs (s + length gs) : ps - transformations :: [Offset3D] - transformations = [ - Offset3D (-1, 0, 0), - Offset3D (0, -1, 0), - Offset3D (0, 0, -1), - Offset3D (1, 0, 0), - Offset3D (0, 1, 0), - Offset3D (0, 0, 1)] - applyTransformations :: Coord3D -> [Offset3D] -> [Coord3D] - applyTransformations _ [] = [] - applyTransformations p (x:xs) = applyOffset p x:applyTransformations p xs - possibleGrowth :: [Coord3D] - possibleGrowth = foldr (\x acc -> insertAllSorted acc (applyTransformations x transformations)) [] la - -insertAllSorted :: (Ord a) => [a] -> [a] -> [a] -insertAllSorted [] [] = [] -insertAllSorted [] [v] = [v] -insertAllSorted xs [] = xs -insertAllSorted xs (y:ys) = insertAllSorted (insertSorted xs y) ys - -insertSorted :: (Ord a) => [a] -> a -> [a] -insertSorted [] v = [v] -insertSorted (x:xs) v - | v < x = v:x:xs - | v > x = insertSorted xs v - | otherwise = x:xs - diff --git a/haskell-old/package.yaml b/haskell-old/package.yaml deleted file mode 100644 index f043078..0000000 --- a/haskell-old/package.yaml +++ /dev/null @@ -1,65 +0,0 @@ -name: pcc-haskell -version: 0.1.0.0 -github: "githubuser/pcc-haskell" -license: BSD-3-Clause -author: "Author name here" -maintainer: "example@example.com" -copyright: "2024 Author name here" - -extra-source-files: -- README.md -- CHANGELOG.md - -# Metadata used when publishing your package -# synopsis: Short description of your package -# category: Web - -# To avoid duplicated efforts in documentation and dealing with the -# complications of embedding Haddock markup inside cabal files, it is -# common to point users to the README.md file. -description: Please see the README on GitHub at - -dependencies: -- base >= 4.7 && < 5 - -ghc-options: -- -Wall -- -Wcompat -- -Widentities -- -Wincomplete-record-updates -- -Wincomplete-uni-patterns -- -Wmissing-export-lists -- -Wmissing-home-modules -- -Wpartial-fields -- -Wredundant-constraints - -library: - source-dirs: src - dependencies: - - hashable - -executables: - pcc-haskell-exe: - main: Main.hs - source-dirs: app - ghc-options: - - -threaded - - -rtsopts - - -with-rtsopts=-N - dependencies: - - pcc-haskell - - unordered-containers - - combinatorial - -tests: - pcc-haskell-test: - main: Spec.hs - source-dirs: test - ghc-options: - - -threaded - - -rtsopts - - -with-rtsopts=-N - dependencies: - - pcc-haskell - - unordered-containers - - combinatorial diff --git a/haskell-old/pcc-haskell.cabal b/haskell-old/pcc-haskell.cabal deleted file mode 100644 index c946aac..0000000 --- a/haskell-old/pcc-haskell.cabal +++ /dev/null @@ -1,72 +0,0 @@ -cabal-version: 2.2 - --- This file has been generated from package.yaml by hpack version 0.36.0. --- --- see: https://github.com/sol/hpack - -name: pcc-haskell -version: 0.1.0.0 -description: Please see the README on GitHub at -homepage: https://github.com/githubuser/pcc-haskell#readme -bug-reports: https://github.com/githubuser/pcc-haskell/issues -author: Author name here -maintainer: example@example.com -copyright: 2024 Author name here -license: BSD-3-Clause -license-file: LICENSE -build-type: Simple -extra-source-files: - README.md - CHANGELOG.md - -source-repository head - type: git - location: https://github.com/githubuser/pcc-haskell - -library - exposed-modules: - PolyCube - other-modules: - Paths_pcc_haskell - autogen-modules: - Paths_pcc_haskell - hs-source-dirs: - src - ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints - build-depends: - base >=4.7 && <5 - , hashable - default-language: Haskell2010 - -executable pcc-haskell-exe - main-is: Main.hs - other-modules: - Paths_pcc_haskell - autogen-modules: - Paths_pcc_haskell - hs-source-dirs: - app - ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints -threaded -rtsopts -with-rtsopts=-N - build-depends: - base >=4.7 && <5 - , combinatorial - , pcc-haskell - , unordered-containers - default-language: Haskell2010 - -test-suite pcc-haskell-test - type: exitcode-stdio-1.0 - main-is: Spec.hs - other-modules: - Paths_pcc_haskell - autogen-modules: - Paths_pcc_haskell - hs-source-dirs: - test - ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints -threaded -rtsopts -with-rtsopts=-N - build-depends: - base >=4.7 && <5 - , combinatorial - , pcc-haskell - , unordered-containers - default-language: Haskell2010 diff --git a/haskell-old/stack.yaml b/haskell-old/stack.yaml deleted file mode 100644 index baad085..0000000 --- a/haskell-old/stack.yaml +++ /dev/null @@ -1,67 +0,0 @@ -# This file was automatically generated by 'stack init' -# -# Some commonly used options have been documented as comments in this file. -# For advanced use and comprehensive documentation of the format, please see: -# https://docs.haskellstack.org/en/stable/yaml_configuration/ - -# Resolver to choose a 'specific' stackage snapshot or a compiler version. -# A snapshot resolver dictates the compiler version and the set of packages -# to be used for project dependencies. For example: -# -# resolver: lts-21.13 -# resolver: nightly-2023-09-24 -# resolver: ghc-9.6.2 -# -# The location of a snapshot can be provided as a file or url. Stack assumes -# a snapshot provided as a file might change, whereas a url resource does not. -# -# resolver: ./custom-snapshot.yaml -# resolver: https://example.com/snapshots/2023-01-01.yaml -resolver: - url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/22/11.yaml - -# User packages to be built. -# Various formats can be used as shown in the example below. -# -# packages: -# - some-directory -# - https://example.com/foo/bar/baz-0.0.2.tar.gz -# subdirs: -# - auto-update -# - wai -packages: -- . -# Dependency packages to be pulled from upstream that are not in the resolver. -# These entries can reference officially published versions as well as -# forks / in-progress versions pinned to a git hash. For example: -# -# extra-deps: -# - acme-missiles-0.3 -# - git: https://github.com/commercialhaskell/stack.git -# commit: e7b331f14bcffb8367cd58fbfc8b40ec7642100a -# -# extra-deps: [] - -# Override default flag values for local packages and extra-deps -# flags: {} - -# Extra package databases containing global packages -# extra-package-dbs: [] - -# Control whether we use the GHC we find on the path -# system-ghc: true -# -# Require a specific version of Stack, using version ranges -# require-stack-version: -any # Default -# require-stack-version: ">=2.13" -# -# Override the architecture used by Stack, especially useful on Windows -# arch: i386 -# arch: x86_64 -# -# Extra directories used by Stack for building -# extra-include-dirs: [/path/to/dir] -# extra-lib-dirs: [/path/to/dir] -# -# Allow a newer minor version of GHC than the snapshot specifies -# compiler-check: newer-minor diff --git a/haskell-old/test/Spec.hs b/haskell-old/test/Spec.hs deleted file mode 100644 index bd60fb7..0000000 --- a/haskell-old/test/Spec.hs +++ /dev/null @@ -1,3 +0,0 @@ -main :: IO () -main = putStrLn "Test suite not yet implemented" - diff --git a/haskell/.gitignore b/haskell/.gitignore deleted file mode 100644 index c368d45..0000000 --- a/haskell/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -.stack-work/ -*~ \ No newline at end of file diff --git a/haskell-old/.stack-work/dist/x86_64-linux/ghc-9.6.4/build-lock b/haskell/.stack-work/dist/x86_64-linux/ghc-9.6.4/build-lock similarity index 100% rename from haskell-old/.stack-work/dist/x86_64-linux/ghc-9.6.4/build-lock rename to haskell/.stack-work/dist/x86_64-linux/ghc-9.6.4/build-lock diff --git a/haskell-old/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/Paths_pcc_haskell.dyn_hi b/haskell/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/Paths_pcc_haskell.dyn_hi similarity index 100% rename from haskell-old/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/Paths_pcc_haskell.dyn_hi rename to haskell/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/Paths_pcc_haskell.dyn_hi diff --git a/haskell-old/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/Paths_pcc_haskell.dyn_o b/haskell/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/Paths_pcc_haskell.dyn_o similarity index 100% rename from haskell-old/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/Paths_pcc_haskell.dyn_o rename to haskell/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/Paths_pcc_haskell.dyn_o diff --git a/haskell-old/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/Paths_pcc_haskell.hi b/haskell/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/Paths_pcc_haskell.hi similarity index 100% rename from haskell-old/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/Paths_pcc_haskell.hi rename to haskell/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/Paths_pcc_haskell.hi diff --git a/haskell-old/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/Paths_pcc_haskell.o b/haskell/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/Paths_pcc_haskell.o similarity index 100% rename from haskell-old/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/Paths_pcc_haskell.o rename to haskell/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/Paths_pcc_haskell.o diff --git a/haskell-old/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/PolyCube.dyn_hi b/haskell/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/PolyCube.dyn_hi similarity index 100% rename from haskell-old/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/PolyCube.dyn_hi rename to haskell/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/PolyCube.dyn_hi diff --git a/haskell-old/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/PolyCube.dyn_o b/haskell/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/PolyCube.dyn_o similarity index 100% rename from haskell-old/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/PolyCube.dyn_o rename to haskell/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/PolyCube.dyn_o diff --git a/haskell-old/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/PolyCube.hi b/haskell/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/PolyCube.hi similarity index 100% rename from haskell-old/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/PolyCube.hi rename to haskell/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/PolyCube.hi diff --git a/haskell-old/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/PolyCube.o b/haskell/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/PolyCube.o similarity index 100% rename from haskell-old/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/PolyCube.o rename to haskell/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/PolyCube.o diff --git a/haskell-old/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/autogen/PackageInfo_pcc_haskell.hs b/haskell/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/autogen/PackageInfo_pcc_haskell.hs similarity index 100% rename from haskell-old/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/autogen/PackageInfo_pcc_haskell.hs rename to haskell/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/autogen/PackageInfo_pcc_haskell.hs diff --git a/haskell-old/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/autogen/Paths_pcc_haskell.hs b/haskell/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/autogen/Paths_pcc_haskell.hs similarity index 100% rename from haskell-old/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/autogen/Paths_pcc_haskell.hs rename to haskell/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/autogen/Paths_pcc_haskell.hs diff --git a/haskell-old/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/autogen/cabal_macros.h b/haskell/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/autogen/cabal_macros.h similarity index 100% rename from haskell-old/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/autogen/cabal_macros.h rename to haskell/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/autogen/cabal_macros.h diff --git a/haskell-old/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/libHSpcc-haskell-0.1.0.0-6K1H0wLq681LrfvIdKcNTn-ghc9.6.4.so b/haskell/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/libHSpcc-haskell-0.1.0.0-6K1H0wLq681LrfvIdKcNTn-ghc9.6.4.so similarity index 100% rename from haskell-old/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/libHSpcc-haskell-0.1.0.0-6K1H0wLq681LrfvIdKcNTn-ghc9.6.4.so rename to haskell/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/libHSpcc-haskell-0.1.0.0-6K1H0wLq681LrfvIdKcNTn-ghc9.6.4.so diff --git a/haskell-old/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/libHSpcc-haskell-0.1.0.0-6K1H0wLq681LrfvIdKcNTn.a b/haskell/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/libHSpcc-haskell-0.1.0.0-6K1H0wLq681LrfvIdKcNTn.a similarity index 100% rename from haskell-old/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/libHSpcc-haskell-0.1.0.0-6K1H0wLq681LrfvIdKcNTn.a rename to haskell/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/libHSpcc-haskell-0.1.0.0-6K1H0wLq681LrfvIdKcNTn.a diff --git a/haskell-old/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/pcc-haskell-exe/autogen/PackageInfo_pcc_haskell.hs b/haskell/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/pcc-haskell-exe/autogen/PackageInfo_pcc_haskell.hs similarity index 100% rename from haskell-old/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/pcc-haskell-exe/autogen/PackageInfo_pcc_haskell.hs rename to haskell/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/pcc-haskell-exe/autogen/PackageInfo_pcc_haskell.hs diff --git a/haskell-old/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/pcc-haskell-exe/autogen/Paths_pcc_haskell.hs b/haskell/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/pcc-haskell-exe/autogen/Paths_pcc_haskell.hs similarity index 100% rename from haskell-old/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/pcc-haskell-exe/autogen/Paths_pcc_haskell.hs rename to haskell/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/pcc-haskell-exe/autogen/Paths_pcc_haskell.hs diff --git a/haskell-old/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/pcc-haskell-exe/autogen/cabal_macros.h b/haskell/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/pcc-haskell-exe/autogen/cabal_macros.h similarity index 100% rename from haskell-old/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/pcc-haskell-exe/autogen/cabal_macros.h rename to haskell/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/pcc-haskell-exe/autogen/cabal_macros.h diff --git a/haskell-old/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/pcc-haskell-exe/pcc-haskell-exe b/haskell/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/pcc-haskell-exe/pcc-haskell-exe similarity index 100% rename from haskell-old/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/pcc-haskell-exe/pcc-haskell-exe rename to haskell/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/pcc-haskell-exe/pcc-haskell-exe diff --git a/haskell-old/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/pcc-haskell-exe/pcc-haskell-exe-tmp/Main.hi b/haskell/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/pcc-haskell-exe/pcc-haskell-exe-tmp/Main.hi similarity index 100% rename from haskell-old/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/pcc-haskell-exe/pcc-haskell-exe-tmp/Main.hi rename to haskell/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/pcc-haskell-exe/pcc-haskell-exe-tmp/Main.hi diff --git a/haskell-old/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/pcc-haskell-exe/pcc-haskell-exe-tmp/Main.o b/haskell/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/pcc-haskell-exe/pcc-haskell-exe-tmp/Main.o similarity index 100% rename from haskell-old/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/pcc-haskell-exe/pcc-haskell-exe-tmp/Main.o rename to haskell/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/pcc-haskell-exe/pcc-haskell-exe-tmp/Main.o diff --git a/haskell-old/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/pcc-haskell-exe/pcc-haskell-exe-tmp/Paths_pcc_haskell.hi b/haskell/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/pcc-haskell-exe/pcc-haskell-exe-tmp/Paths_pcc_haskell.hi similarity index 100% rename from haskell-old/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/pcc-haskell-exe/pcc-haskell-exe-tmp/Paths_pcc_haskell.hi rename to haskell/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/pcc-haskell-exe/pcc-haskell-exe-tmp/Paths_pcc_haskell.hi diff --git a/haskell-old/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/pcc-haskell-exe/pcc-haskell-exe-tmp/Paths_pcc_haskell.o b/haskell/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/pcc-haskell-exe/pcc-haskell-exe-tmp/Paths_pcc_haskell.o similarity index 100% rename from haskell-old/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/pcc-haskell-exe/pcc-haskell-exe-tmp/Paths_pcc_haskell.o rename to haskell/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/pcc-haskell-exe/pcc-haskell-exe-tmp/Paths_pcc_haskell.o diff --git a/haskell-old/.stack-work/dist/x86_64-linux/ghc-9.6.4/package.conf.inplace/package.cache.lock b/haskell/.stack-work/dist/x86_64-linux/ghc-9.6.4/package.conf.inplace/package.cache.lock similarity index 100% rename from haskell-old/.stack-work/dist/x86_64-linux/ghc-9.6.4/package.conf.inplace/package.cache.lock rename to haskell/.stack-work/dist/x86_64-linux/ghc-9.6.4/package.conf.inplace/package.cache.lock diff --git a/haskell-old/.stack-work/dist/x86_64-linux/ghc-9.6.4/package.conf.inplace/pcc-haskell-0.1.0.0-6K1H0wLq681LrfvIdKcNTn.conf b/haskell/.stack-work/dist/x86_64-linux/ghc-9.6.4/package.conf.inplace/pcc-haskell-0.1.0.0-6K1H0wLq681LrfvIdKcNTn.conf similarity index 100% rename from haskell-old/.stack-work/dist/x86_64-linux/ghc-9.6.4/package.conf.inplace/pcc-haskell-0.1.0.0-6K1H0wLq681LrfvIdKcNTn.conf rename to haskell/.stack-work/dist/x86_64-linux/ghc-9.6.4/package.conf.inplace/pcc-haskell-0.1.0.0-6K1H0wLq681LrfvIdKcNTn.conf diff --git a/haskell-old/.stack-work/dist/x86_64-linux/ghc-9.6.4/setup-config b/haskell/.stack-work/dist/x86_64-linux/ghc-9.6.4/setup-config similarity index 100% rename from haskell-old/.stack-work/dist/x86_64-linux/ghc-9.6.4/setup-config rename to haskell/.stack-work/dist/x86_64-linux/ghc-9.6.4/setup-config diff --git a/haskell-old/.stack-work/dist/x86_64-linux/ghc-9.6.4/stack-build-caches/75fd8e4951838cd19ff034f1d6b677ab2be4fb856638520103bae2e94ff9d516/exe-pcc-haskell-exe b/haskell/.stack-work/dist/x86_64-linux/ghc-9.6.4/stack-build-caches/75fd8e4951838cd19ff034f1d6b677ab2be4fb856638520103bae2e94ff9d516/exe-pcc-haskell-exe similarity index 100% rename from haskell-old/.stack-work/dist/x86_64-linux/ghc-9.6.4/stack-build-caches/75fd8e4951838cd19ff034f1d6b677ab2be4fb856638520103bae2e94ff9d516/exe-pcc-haskell-exe rename to haskell/.stack-work/dist/x86_64-linux/ghc-9.6.4/stack-build-caches/75fd8e4951838cd19ff034f1d6b677ab2be4fb856638520103bae2e94ff9d516/exe-pcc-haskell-exe diff --git a/haskell-old/.stack-work/dist/x86_64-linux/ghc-9.6.4/stack-build-caches/75fd8e4951838cd19ff034f1d6b677ab2be4fb856638520103bae2e94ff9d516/lib b/haskell/.stack-work/dist/x86_64-linux/ghc-9.6.4/stack-build-caches/75fd8e4951838cd19ff034f1d6b677ab2be4fb856638520103bae2e94ff9d516/lib similarity index 100% rename from haskell-old/.stack-work/dist/x86_64-linux/ghc-9.6.4/stack-build-caches/75fd8e4951838cd19ff034f1d6b677ab2be4fb856638520103bae2e94ff9d516/lib rename to haskell/.stack-work/dist/x86_64-linux/ghc-9.6.4/stack-build-caches/75fd8e4951838cd19ff034f1d6b677ab2be4fb856638520103bae2e94ff9d516/lib diff --git a/haskell-old/.stack-work/dist/x86_64-linux/ghc-9.6.4/stack-cabal-mod b/haskell/.stack-work/dist/x86_64-linux/ghc-9.6.4/stack-cabal-mod similarity index 100% rename from haskell-old/.stack-work/dist/x86_64-linux/ghc-9.6.4/stack-cabal-mod rename to haskell/.stack-work/dist/x86_64-linux/ghc-9.6.4/stack-cabal-mod diff --git a/haskell-old/.stack-work/dist/x86_64-linux/ghc-9.6.4/stack-project-root b/haskell/.stack-work/dist/x86_64-linux/ghc-9.6.4/stack-project-root similarity index 100% rename from haskell-old/.stack-work/dist/x86_64-linux/ghc-9.6.4/stack-project-root rename to haskell/.stack-work/dist/x86_64-linux/ghc-9.6.4/stack-project-root diff --git a/haskell-old/.stack-work/dist/x86_64-linux/ghc-9.6.4/stack-setup-config-mod b/haskell/.stack-work/dist/x86_64-linux/ghc-9.6.4/stack-setup-config-mod similarity index 100% rename from haskell-old/.stack-work/dist/x86_64-linux/ghc-9.6.4/stack-setup-config-mod rename to haskell/.stack-work/dist/x86_64-linux/ghc-9.6.4/stack-setup-config-mod diff --git a/haskell-old/.stack-work/install/x86_64-linux/75fd8e4951838cd19ff034f1d6b677ab2be4fb856638520103bae2e94ff9d516/9.6.4/doc/pcc-haskell-0.1.0.0/LICENSE b/haskell/.stack-work/install/x86_64-linux/75fd8e4951838cd19ff034f1d6b677ab2be4fb856638520103bae2e94ff9d516/9.6.4/doc/pcc-haskell-0.1.0.0/LICENSE similarity index 100% rename from haskell-old/.stack-work/install/x86_64-linux/75fd8e4951838cd19ff034f1d6b677ab2be4fb856638520103bae2e94ff9d516/9.6.4/doc/pcc-haskell-0.1.0.0/LICENSE rename to haskell/.stack-work/install/x86_64-linux/75fd8e4951838cd19ff034f1d6b677ab2be4fb856638520103bae2e94ff9d516/9.6.4/doc/pcc-haskell-0.1.0.0/LICENSE diff --git a/haskell-old/.stack-work/install/x86_64-linux/75fd8e4951838cd19ff034f1d6b677ab2be4fb856638520103bae2e94ff9d516/9.6.4/lib/x86_64-linux-ghc-9.6.4/libHSpcc-haskell-0.1.0.0-6K1H0wLq681LrfvIdKcNTn-ghc9.6.4.so b/haskell/.stack-work/install/x86_64-linux/75fd8e4951838cd19ff034f1d6b677ab2be4fb856638520103bae2e94ff9d516/9.6.4/lib/x86_64-linux-ghc-9.6.4/libHSpcc-haskell-0.1.0.0-6K1H0wLq681LrfvIdKcNTn-ghc9.6.4.so similarity index 100% rename from haskell-old/.stack-work/install/x86_64-linux/75fd8e4951838cd19ff034f1d6b677ab2be4fb856638520103bae2e94ff9d516/9.6.4/lib/x86_64-linux-ghc-9.6.4/libHSpcc-haskell-0.1.0.0-6K1H0wLq681LrfvIdKcNTn-ghc9.6.4.so rename to haskell/.stack-work/install/x86_64-linux/75fd8e4951838cd19ff034f1d6b677ab2be4fb856638520103bae2e94ff9d516/9.6.4/lib/x86_64-linux-ghc-9.6.4/libHSpcc-haskell-0.1.0.0-6K1H0wLq681LrfvIdKcNTn-ghc9.6.4.so diff --git a/haskell-old/.stack-work/install/x86_64-linux/75fd8e4951838cd19ff034f1d6b677ab2be4fb856638520103bae2e94ff9d516/9.6.4/lib/x86_64-linux-ghc-9.6.4/pcc-haskell-0.1.0.0-6K1H0wLq681LrfvIdKcNTn/Paths_pcc_haskell.dyn_hi b/haskell/.stack-work/install/x86_64-linux/75fd8e4951838cd19ff034f1d6b677ab2be4fb856638520103bae2e94ff9d516/9.6.4/lib/x86_64-linux-ghc-9.6.4/pcc-haskell-0.1.0.0-6K1H0wLq681LrfvIdKcNTn/Paths_pcc_haskell.dyn_hi similarity index 100% rename from haskell-old/.stack-work/install/x86_64-linux/75fd8e4951838cd19ff034f1d6b677ab2be4fb856638520103bae2e94ff9d516/9.6.4/lib/x86_64-linux-ghc-9.6.4/pcc-haskell-0.1.0.0-6K1H0wLq681LrfvIdKcNTn/Paths_pcc_haskell.dyn_hi rename to haskell/.stack-work/install/x86_64-linux/75fd8e4951838cd19ff034f1d6b677ab2be4fb856638520103bae2e94ff9d516/9.6.4/lib/x86_64-linux-ghc-9.6.4/pcc-haskell-0.1.0.0-6K1H0wLq681LrfvIdKcNTn/Paths_pcc_haskell.dyn_hi diff --git a/haskell-old/.stack-work/install/x86_64-linux/75fd8e4951838cd19ff034f1d6b677ab2be4fb856638520103bae2e94ff9d516/9.6.4/lib/x86_64-linux-ghc-9.6.4/pcc-haskell-0.1.0.0-6K1H0wLq681LrfvIdKcNTn/Paths_pcc_haskell.hi b/haskell/.stack-work/install/x86_64-linux/75fd8e4951838cd19ff034f1d6b677ab2be4fb856638520103bae2e94ff9d516/9.6.4/lib/x86_64-linux-ghc-9.6.4/pcc-haskell-0.1.0.0-6K1H0wLq681LrfvIdKcNTn/Paths_pcc_haskell.hi similarity index 100% rename from haskell-old/.stack-work/install/x86_64-linux/75fd8e4951838cd19ff034f1d6b677ab2be4fb856638520103bae2e94ff9d516/9.6.4/lib/x86_64-linux-ghc-9.6.4/pcc-haskell-0.1.0.0-6K1H0wLq681LrfvIdKcNTn/Paths_pcc_haskell.hi rename to haskell/.stack-work/install/x86_64-linux/75fd8e4951838cd19ff034f1d6b677ab2be4fb856638520103bae2e94ff9d516/9.6.4/lib/x86_64-linux-ghc-9.6.4/pcc-haskell-0.1.0.0-6K1H0wLq681LrfvIdKcNTn/Paths_pcc_haskell.hi diff --git a/haskell-old/.stack-work/install/x86_64-linux/75fd8e4951838cd19ff034f1d6b677ab2be4fb856638520103bae2e94ff9d516/9.6.4/lib/x86_64-linux-ghc-9.6.4/pcc-haskell-0.1.0.0-6K1H0wLq681LrfvIdKcNTn/PolyCube.dyn_hi b/haskell/.stack-work/install/x86_64-linux/75fd8e4951838cd19ff034f1d6b677ab2be4fb856638520103bae2e94ff9d516/9.6.4/lib/x86_64-linux-ghc-9.6.4/pcc-haskell-0.1.0.0-6K1H0wLq681LrfvIdKcNTn/PolyCube.dyn_hi similarity index 100% rename from haskell-old/.stack-work/install/x86_64-linux/75fd8e4951838cd19ff034f1d6b677ab2be4fb856638520103bae2e94ff9d516/9.6.4/lib/x86_64-linux-ghc-9.6.4/pcc-haskell-0.1.0.0-6K1H0wLq681LrfvIdKcNTn/PolyCube.dyn_hi rename to haskell/.stack-work/install/x86_64-linux/75fd8e4951838cd19ff034f1d6b677ab2be4fb856638520103bae2e94ff9d516/9.6.4/lib/x86_64-linux-ghc-9.6.4/pcc-haskell-0.1.0.0-6K1H0wLq681LrfvIdKcNTn/PolyCube.dyn_hi diff --git a/haskell-old/.stack-work/install/x86_64-linux/75fd8e4951838cd19ff034f1d6b677ab2be4fb856638520103bae2e94ff9d516/9.6.4/lib/x86_64-linux-ghc-9.6.4/pcc-haskell-0.1.0.0-6K1H0wLq681LrfvIdKcNTn/PolyCube.hi b/haskell/.stack-work/install/x86_64-linux/75fd8e4951838cd19ff034f1d6b677ab2be4fb856638520103bae2e94ff9d516/9.6.4/lib/x86_64-linux-ghc-9.6.4/pcc-haskell-0.1.0.0-6K1H0wLq681LrfvIdKcNTn/PolyCube.hi similarity index 100% rename from haskell-old/.stack-work/install/x86_64-linux/75fd8e4951838cd19ff034f1d6b677ab2be4fb856638520103bae2e94ff9d516/9.6.4/lib/x86_64-linux-ghc-9.6.4/pcc-haskell-0.1.0.0-6K1H0wLq681LrfvIdKcNTn/PolyCube.hi rename to haskell/.stack-work/install/x86_64-linux/75fd8e4951838cd19ff034f1d6b677ab2be4fb856638520103bae2e94ff9d516/9.6.4/lib/x86_64-linux-ghc-9.6.4/pcc-haskell-0.1.0.0-6K1H0wLq681LrfvIdKcNTn/PolyCube.hi diff --git a/haskell-old/.stack-work/install/x86_64-linux/75fd8e4951838cd19ff034f1d6b677ab2be4fb856638520103bae2e94ff9d516/9.6.4/lib/x86_64-linux-ghc-9.6.4/pcc-haskell-0.1.0.0-6K1H0wLq681LrfvIdKcNTn/libHSpcc-haskell-0.1.0.0-6K1H0wLq681LrfvIdKcNTn.a b/haskell/.stack-work/install/x86_64-linux/75fd8e4951838cd19ff034f1d6b677ab2be4fb856638520103bae2e94ff9d516/9.6.4/lib/x86_64-linux-ghc-9.6.4/pcc-haskell-0.1.0.0-6K1H0wLq681LrfvIdKcNTn/libHSpcc-haskell-0.1.0.0-6K1H0wLq681LrfvIdKcNTn.a similarity index 100% rename from haskell-old/.stack-work/install/x86_64-linux/75fd8e4951838cd19ff034f1d6b677ab2be4fb856638520103bae2e94ff9d516/9.6.4/lib/x86_64-linux-ghc-9.6.4/pcc-haskell-0.1.0.0-6K1H0wLq681LrfvIdKcNTn/libHSpcc-haskell-0.1.0.0-6K1H0wLq681LrfvIdKcNTn.a rename to haskell/.stack-work/install/x86_64-linux/75fd8e4951838cd19ff034f1d6b677ab2be4fb856638520103bae2e94ff9d516/9.6.4/lib/x86_64-linux-ghc-9.6.4/pcc-haskell-0.1.0.0-6K1H0wLq681LrfvIdKcNTn/libHSpcc-haskell-0.1.0.0-6K1H0wLq681LrfvIdKcNTn.a diff --git a/haskell-old/.stack-work/install/x86_64-linux/75fd8e4951838cd19ff034f1d6b677ab2be4fb856638520103bae2e94ff9d516/9.6.4/pkgdb/package.cache.lock b/haskell/.stack-work/install/x86_64-linux/75fd8e4951838cd19ff034f1d6b677ab2be4fb856638520103bae2e94ff9d516/9.6.4/pkgdb/package.cache.lock similarity index 100% rename from haskell-old/.stack-work/install/x86_64-linux/75fd8e4951838cd19ff034f1d6b677ab2be4fb856638520103bae2e94ff9d516/9.6.4/pkgdb/package.cache.lock rename to haskell/.stack-work/install/x86_64-linux/75fd8e4951838cd19ff034f1d6b677ab2be4fb856638520103bae2e94ff9d516/9.6.4/pkgdb/package.cache.lock diff --git a/haskell-old/.stack-work/install/x86_64-linux/75fd8e4951838cd19ff034f1d6b677ab2be4fb856638520103bae2e94ff9d516/9.6.4/pkgdb/pcc-haskell-0.1.0.0-6K1H0wLq681LrfvIdKcNTn.conf b/haskell/.stack-work/install/x86_64-linux/75fd8e4951838cd19ff034f1d6b677ab2be4fb856638520103bae2e94ff9d516/9.6.4/pkgdb/pcc-haskell-0.1.0.0-6K1H0wLq681LrfvIdKcNTn.conf similarity index 100% rename from haskell-old/.stack-work/install/x86_64-linux/75fd8e4951838cd19ff034f1d6b677ab2be4fb856638520103bae2e94ff9d516/9.6.4/pkgdb/pcc-haskell-0.1.0.0-6K1H0wLq681LrfvIdKcNTn.conf rename to haskell/.stack-work/install/x86_64-linux/75fd8e4951838cd19ff034f1d6b677ab2be4fb856638520103bae2e94ff9d516/9.6.4/pkgdb/pcc-haskell-0.1.0.0-6K1H0wLq681LrfvIdKcNTn.conf diff --git a/haskell-old/.stack-work/stack.sqlite3 b/haskell/.stack-work/stack.sqlite3 similarity index 100% rename from haskell-old/.stack-work/stack.sqlite3 rename to haskell/.stack-work/stack.sqlite3 diff --git a/haskell-old/.stack-work/stack.sqlite3.pantry-write-lock b/haskell/.stack-work/stack.sqlite3.pantry-write-lock similarity index 100% rename from haskell-old/.stack-work/stack.sqlite3.pantry-write-lock rename to haskell/.stack-work/stack.sqlite3.pantry-write-lock diff --git a/haskell/app/Main.hs b/haskell/app/Main.hs index 4c6b30f..263da10 100644 --- a/haskell/app/Main.hs +++ b/haskell/app/Main.hs @@ -1,6 +1,73 @@ module Main (main) where -import Lib +import PolyCube +import Text.Read (readMaybe) +import System.Exit ( ExitCode(ExitFailure), exitWith ) +import System.Environment (getArgs) +import qualified Data.HashMap.Strict as Map +import Combinatorics main :: IO () -main = someFunc +main = do + maxSize <- parseCLIArgs + let cube = PolyCube (map (const [Coord3D (0, 0, 0)]) ([1..24]::[Int])) [Coord3D (0, 0, 0)] 1 + let polycubes = Map.singleton (getOffsets $ head $ orientations cube) (size cube, head $ orientations cube) + let result = evaluateChildren maxSize cube polycubes + let counts = foldr (increment . fst) [] result + writeFile "count.out" $ show counts + return () + +increment :: Int -> [Int] -> [Int] +increment 1 [] = [1] +increment n [] = 0:increment (n-1) [] +increment 1 (x:xs) = (x+1):xs +increment n (x:xs) = x:increment (n-1) xs + +parseCLIArgs :: IO Int +parseCLIArgs = do + args <- getArgs + let maxSize = readMaybe $ head args :: Maybe Int + maybe (exitWith $ ExitFailure 1) return maxSize + +evaluateChildren :: Int -> PolyCube -> Map.HashMap [Offset3D] (Int, [Coord3D]) -> Map.HashMap [Offset3D] (Int, [Coord3D]) +evaluateChildren maxSize polycube = loop (getChildren (maxSize - size polycube) polycube) where + loop :: [PolyCube] -> Map.HashMap [Offset3D] (Int, [Coord3D]) -> Map.HashMap [Offset3D] (Int, [Coord3D]) + loop [] d = d + loop ((PolyCube o la s):pcs) d = if any (flip Map.member d . getOffsets) o + then loop pcs d + else loop pcs $ evaluateChildren maxSize (PolyCube o la s) $ Map.insert (getOffsets $ head o) (s, head o) d + +getChildren :: Int -> PolyCube -> [PolyCube] +getChildren 0 _ = [] +getChildren i (PolyCube o la s) = foldr condGrowth [] $ foldr (\x acc -> tuples x possibleGrowth ++ acc) [] [1..i] where + condGrowth :: [Coord3D] -> [PolyCube] -> [PolyCube] + condGrowth gs ps = if any (\x -> elem x $ head o) gs + then ps + else PolyCube (zipWith (\x n -> insertAllSorted x $ rotateCubes gs n) o [1..24]) gs (s + length gs) : ps + transformations :: [Offset3D] + transformations = [ + Offset3D (-1, 0, 0), + Offset3D (0, -1, 0), + Offset3D (0, 0, -1), + Offset3D (1, 0, 0), + Offset3D (0, 1, 0), + Offset3D (0, 0, 1)] + applyTransformations :: Coord3D -> [Offset3D] -> [Coord3D] + applyTransformations _ [] = [] + applyTransformations p (x:xs) = applyOffset p x:applyTransformations p xs + possibleGrowth :: [Coord3D] + possibleGrowth = foldr (\x acc -> insertAllSorted acc (applyTransformations x transformations)) [] la + +insertAllSorted :: (Ord a) => [a] -> [a] -> [a] +insertAllSorted [] [] = [] +insertAllSorted [] [v] = [v] +insertAllSorted xs [] = xs +insertAllSorted xs (y:ys) = insertAllSorted (insertSorted xs y) ys + +insertSorted :: (Ord a) => [a] -> a -> [a] +insertSorted [] v = [v] +insertSorted (x:xs) v + | v < x = v:x:xs + | v > x = insertSorted xs v + | otherwise = x:xs + diff --git a/haskell-old/count.out b/haskell/count.out similarity index 100% rename from haskell-old/count.out rename to haskell/count.out diff --git a/haskell/package.yaml b/haskell/package.yaml index e775f53..f043078 100644 --- a/haskell/package.yaml +++ b/haskell/package.yaml @@ -35,6 +35,8 @@ ghc-options: library: source-dirs: src + dependencies: + - hashable executables: pcc-haskell-exe: @@ -46,6 +48,8 @@ executables: - -with-rtsopts=-N dependencies: - pcc-haskell + - unordered-containers + - combinatorial tests: pcc-haskell-test: @@ -57,3 +61,5 @@ tests: - -with-rtsopts=-N dependencies: - pcc-haskell + - unordered-containers + - combinatorial diff --git a/haskell/pcc-haskell.cabal b/haskell/pcc-haskell.cabal index 1c3790c..c946aac 100644 --- a/haskell/pcc-haskell.cabal +++ b/haskell/pcc-haskell.cabal @@ -25,7 +25,7 @@ source-repository head library exposed-modules: - Lib + PolyCube other-modules: Paths_pcc_haskell autogen-modules: @@ -35,6 +35,7 @@ library ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints build-depends: base >=4.7 && <5 + , hashable default-language: Haskell2010 executable pcc-haskell-exe @@ -48,7 +49,9 @@ executable pcc-haskell-exe ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints -threaded -rtsopts -with-rtsopts=-N build-depends: base >=4.7 && <5 + , combinatorial , pcc-haskell + , unordered-containers default-language: Haskell2010 test-suite pcc-haskell-test @@ -63,5 +66,7 @@ test-suite pcc-haskell-test ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints -threaded -rtsopts -with-rtsopts=-N build-depends: base >=4.7 && <5 + , combinatorial , pcc-haskell + , unordered-containers default-language: Haskell2010 diff --git a/haskell/src/Lib.hs b/haskell/src/Lib.hs deleted file mode 100644 index d36ff27..0000000 --- a/haskell/src/Lib.hs +++ /dev/null @@ -1,6 +0,0 @@ -module Lib - ( someFunc - ) where - -someFunc :: IO () -someFunc = putStrLn "someFunc" diff --git a/haskell-old/src/PolyCube.hs b/haskell/src/PolyCube.hs similarity index 100% rename from haskell-old/src/PolyCube.hs rename to haskell/src/PolyCube.hs diff --git a/haskell/stack.yaml b/haskell/stack.yaml index 378a582..baad085 100644 --- a/haskell/stack.yaml +++ b/haskell/stack.yaml @@ -8,9 +8,9 @@ # A snapshot resolver dictates the compiler version and the set of packages # to be used for project dependencies. For example: # -# resolver: lts-22.7 -# resolver: nightly-2024-01-20 -# resolver: ghc-9.6.4 +# resolver: lts-21.13 +# resolver: nightly-2023-09-24 +# resolver: ghc-9.6.2 # # The location of a snapshot can be provided as a file or url. Stack assumes # a snapshot provided as a file might change, whereas a url resource does not. @@ -18,7 +18,7 @@ # resolver: ./custom-snapshot.yaml # resolver: https://example.com/snapshots/2023-01-01.yaml resolver: - url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/22/15.yaml + url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/22/11.yaml # User packages to be built. # Various formats can be used as shown in the example below. @@ -53,7 +53,7 @@ packages: # # Require a specific version of Stack, using version ranges # require-stack-version: -any # Default -# require-stack-version: ">=2.15" +# require-stack-version: ">=2.13" # # Override the architecture used by Stack, especially useful on Windows # arch: i386 diff --git a/haskell-old/stack.yaml.lock b/haskell/stack.yaml.lock similarity index 100% rename from haskell-old/stack.yaml.lock rename to haskell/stack.yaml.lock diff --git a/haskell/test/Spec.hs b/haskell/test/Spec.hs index cd4753f..bd60fb7 100644 --- a/haskell/test/Spec.hs +++ b/haskell/test/Spec.hs @@ -1,2 +1,3 @@ main :: IO () main = putStrLn "Test suite not yet implemented" +