Please enter the commit message for your changes. Lines starting

This commit is contained in:
Maxime Vorwerk
2024-04-12 16:55:50 +02:00
parent 309fabe525
commit 43c782078d
60 changed files with 87 additions and 340 deletions

2
haskell/.gitignore vendored
View File

@@ -1,2 +0,0 @@
.stack-work/
*~

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,25 @@
{-# LANGUAGE NoRebindableSyntax #-}
{-# OPTIONS_GHC -fno-warn-missing-import-lists #-}
{-# OPTIONS_GHC -w #-}
module PackageInfo_pcc_haskell (
name,
version,
synopsis,
copyright,
homepage,
) where
import Data.Version (Version(..))
import Prelude
name :: String
name = "pcc_haskell"
version :: Version
version = Version [0,1,0,0] []
synopsis :: String
synopsis = ""
copyright :: String
copyright = "2024 Author name here"
homepage :: String
homepage = "https://github.com/githubuser/pcc-haskell#readme"

View File

@@ -0,0 +1,77 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE NoRebindableSyntax #-}
#if __GLASGOW_HASKELL__ >= 810
{-# OPTIONS_GHC -Wno-prepositive-qualified-module #-}
#endif
{-# OPTIONS_GHC -fno-warn-missing-import-lists #-}
{-# OPTIONS_GHC -w #-}
module Paths_pcc_haskell (
version,
getBinDir, getLibDir, getDynLibDir, getDataDir, getLibexecDir,
getDataFileName, getSysconfDir
) where
import qualified Control.Exception as Exception
import qualified Data.List as List
import Data.Version (Version(..))
import System.Environment (getEnv)
import Prelude
#if defined(VERSION_base)
#if MIN_VERSION_base(4,0,0)
catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a
#else
catchIO :: IO a -> (Exception.Exception -> IO a) -> IO a
#endif
#else
catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a
#endif
catchIO = Exception.catch
version :: Version
version = Version [0,1,0,0] []
getDataFileName :: FilePath -> IO FilePath
getDataFileName name = do
dir <- getDataDir
return (dir `joinFileName` name)
getBinDir, getLibDir, getDynLibDir, getDataDir, getLibexecDir, getSysconfDir :: IO FilePath
bindir, libdir, dynlibdir, datadir, libexecdir, sysconfdir :: FilePath
bindir = "/home/maxime/source/PolyCubeCounting/haskell/.stack-work/install/x86_64-linux/75fd8e4951838cd19ff034f1d6b677ab2be4fb856638520103bae2e94ff9d516/9.6.4/bin"
libdir = "/home/maxime/source/PolyCubeCounting/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"
dynlibdir = "/home/maxime/source/PolyCubeCounting/haskell/.stack-work/install/x86_64-linux/75fd8e4951838cd19ff034f1d6b677ab2be4fb856638520103bae2e94ff9d516/9.6.4/lib/x86_64-linux-ghc-9.6.4"
datadir = "/home/maxime/source/PolyCubeCounting/haskell/.stack-work/install/x86_64-linux/75fd8e4951838cd19ff034f1d6b677ab2be4fb856638520103bae2e94ff9d516/9.6.4/share/x86_64-linux-ghc-9.6.4/pcc-haskell-0.1.0.0"
libexecdir = "/home/maxime/source/PolyCubeCounting/haskell/.stack-work/install/x86_64-linux/75fd8e4951838cd19ff034f1d6b677ab2be4fb856638520103bae2e94ff9d516/9.6.4/libexec/x86_64-linux-ghc-9.6.4/pcc-haskell-0.1.0.0"
sysconfdir = "/home/maxime/source/PolyCubeCounting/haskell/.stack-work/install/x86_64-linux/75fd8e4951838cd19ff034f1d6b677ab2be4fb856638520103bae2e94ff9d516/9.6.4/etc"
getBinDir = catchIO (getEnv "pcc_haskell_bindir") (\_ -> return bindir)
getLibDir = catchIO (getEnv "pcc_haskell_libdir") (\_ -> return libdir)
getDynLibDir = catchIO (getEnv "pcc_haskell_dynlibdir") (\_ -> return dynlibdir)
getDataDir = catchIO (getEnv "pcc_haskell_datadir") (\_ -> return datadir)
getLibexecDir = catchIO (getEnv "pcc_haskell_libexecdir") (\_ -> return libexecdir)
getSysconfDir = catchIO (getEnv "pcc_haskell_sysconfdir") (\_ -> return sysconfdir)
joinFileName :: String -> String -> FilePath
joinFileName "" fname = fname
joinFileName "." fname = fname
joinFileName dir "" = dir
joinFileName dir fname
| isPathSeparator (List.last dir) = dir ++ fname
| otherwise = dir ++ pathSeparator : fname
pathSeparator :: Char
pathSeparator = '/'
isPathSeparator :: Char -> Bool
isPathSeparator c = c == '/'

View File

@@ -0,0 +1,133 @@
/* DO NOT EDIT: This file is automatically generated by Cabal */
/* package pcc-haskell-0.1.0.0 */
#ifndef VERSION_pcc_haskell
#define VERSION_pcc_haskell "0.1.0.0"
#endif /* VERSION_pcc_haskell */
#ifndef MIN_VERSION_pcc_haskell
#define MIN_VERSION_pcc_haskell(major1,major2,minor) (\
(major1) < 0 || \
(major1) == 0 && (major2) < 1 || \
(major1) == 0 && (major2) == 1 && (minor) <= 0)
#endif /* MIN_VERSION_pcc_haskell */
/* package base-4.18.2.0 */
#ifndef VERSION_base
#define VERSION_base "4.18.2.0"
#endif /* VERSION_base */
#ifndef MIN_VERSION_base
#define MIN_VERSION_base(major1,major2,minor) (\
(major1) < 4 || \
(major1) == 4 && (major2) < 18 || \
(major1) == 4 && (major2) == 18 && (minor) <= 2)
#endif /* MIN_VERSION_base */
/* package hashable-1.4.3.0 */
#ifndef VERSION_hashable
#define VERSION_hashable "1.4.3.0"
#endif /* VERSION_hashable */
#ifndef MIN_VERSION_hashable
#define MIN_VERSION_hashable(major1,major2,minor) (\
(major1) < 1 || \
(major1) == 1 && (major2) < 4 || \
(major1) == 1 && (major2) == 4 && (minor) <= 3)
#endif /* MIN_VERSION_hashable */
/* tool gcc-11 */
#ifndef TOOL_VERSION_gcc
#define TOOL_VERSION_gcc "11"
#endif /* TOOL_VERSION_gcc */
#ifndef MIN_TOOL_VERSION_gcc
#define MIN_TOOL_VERSION_gcc(major1,major2,minor) (\
(major1) < 11 || \
(major1) == 11 && (major2) < 0 || \
(major1) == 11 && (major2) == 0 && (minor) <= 0)
#endif /* MIN_TOOL_VERSION_gcc */
/* tool ghc-9.6.4 */
#ifndef TOOL_VERSION_ghc
#define TOOL_VERSION_ghc "9.6.4"
#endif /* TOOL_VERSION_ghc */
#ifndef MIN_TOOL_VERSION_ghc
#define MIN_TOOL_VERSION_ghc(major1,major2,minor) (\
(major1) < 9 || \
(major1) == 9 && (major2) < 6 || \
(major1) == 9 && (major2) == 6 && (minor) <= 4)
#endif /* MIN_TOOL_VERSION_ghc */
/* tool ghc-pkg-9.6.4 */
#ifndef TOOL_VERSION_ghc_pkg
#define TOOL_VERSION_ghc_pkg "9.6.4"
#endif /* TOOL_VERSION_ghc_pkg */
#ifndef MIN_TOOL_VERSION_ghc_pkg
#define MIN_TOOL_VERSION_ghc_pkg(major1,major2,minor) (\
(major1) < 9 || \
(major1) == 9 && (major2) < 6 || \
(major1) == 9 && (major2) == 6 && (minor) <= 4)
#endif /* MIN_TOOL_VERSION_ghc_pkg */
/* tool haddock-2.29.2 */
#ifndef TOOL_VERSION_haddock
#define TOOL_VERSION_haddock "2.29.2"
#endif /* TOOL_VERSION_haddock */
#ifndef MIN_TOOL_VERSION_haddock
#define MIN_TOOL_VERSION_haddock(major1,major2,minor) (\
(major1) < 2 || \
(major1) == 2 && (major2) < 29 || \
(major1) == 2 && (major2) == 29 && (minor) <= 2)
#endif /* MIN_TOOL_VERSION_haddock */
/* tool hpc-0.68 */
#ifndef TOOL_VERSION_hpc
#define TOOL_VERSION_hpc "0.68"
#endif /* TOOL_VERSION_hpc */
#ifndef MIN_TOOL_VERSION_hpc
#define MIN_TOOL_VERSION_hpc(major1,major2,minor) (\
(major1) < 0 || \
(major1) == 0 && (major2) < 68 || \
(major1) == 0 && (major2) == 68 && (minor) <= 0)
#endif /* MIN_TOOL_VERSION_hpc */
/* tool hsc2hs-0.68.9 */
#ifndef TOOL_VERSION_hsc2hs
#define TOOL_VERSION_hsc2hs "0.68.9"
#endif /* TOOL_VERSION_hsc2hs */
#ifndef MIN_TOOL_VERSION_hsc2hs
#define MIN_TOOL_VERSION_hsc2hs(major1,major2,minor) (\
(major1) < 0 || \
(major1) == 0 && (major2) < 68 || \
(major1) == 0 && (major2) == 68 && (minor) <= 9)
#endif /* MIN_TOOL_VERSION_hsc2hs */
/* tool pkg-config-0.29.2 */
#ifndef TOOL_VERSION_pkg_config
#define TOOL_VERSION_pkg_config "0.29.2"
#endif /* TOOL_VERSION_pkg_config */
#ifndef MIN_TOOL_VERSION_pkg_config
#define MIN_TOOL_VERSION_pkg_config(major1,major2,minor) (\
(major1) < 0 || \
(major1) == 0 && (major2) < 29 || \
(major1) == 0 && (major2) == 29 && (minor) <= 2)
#endif /* MIN_TOOL_VERSION_pkg_config */
/* tool runghc-9.6.4 */
#ifndef TOOL_VERSION_runghc
#define TOOL_VERSION_runghc "9.6.4"
#endif /* TOOL_VERSION_runghc */
#ifndef MIN_TOOL_VERSION_runghc
#define MIN_TOOL_VERSION_runghc(major1,major2,minor) (\
(major1) < 9 || \
(major1) == 9 && (major2) < 6 || \
(major1) == 9 && (major2) == 6 && (minor) <= 4)
#endif /* MIN_TOOL_VERSION_runghc */
/* tool strip-2.38 */
#ifndef TOOL_VERSION_strip
#define TOOL_VERSION_strip "2.38"
#endif /* TOOL_VERSION_strip */
#ifndef MIN_TOOL_VERSION_strip
#define MIN_TOOL_VERSION_strip(major1,major2,minor) (\
(major1) < 2 || \
(major1) == 2 && (major2) < 38 || \
(major1) == 2 && (major2) == 38 && (minor) <= 0)
#endif /* MIN_TOOL_VERSION_strip */
#ifndef CURRENT_PACKAGE_KEY
#define CURRENT_PACKAGE_KEY "pcc-haskell-0.1.0.0-6K1H0wLq681LrfvIdKcNTn"
#endif /* CURRENT_packageKey */
#ifndef CURRENT_COMPONENT_ID
#define CURRENT_COMPONENT_ID "pcc-haskell-0.1.0.0-6K1H0wLq681LrfvIdKcNTn"
#endif /* CURRENT_COMPONENT_ID */
#ifndef CURRENT_PACKAGE_VERSION
#define CURRENT_PACKAGE_VERSION "0.1.0.0"
#endif /* CURRENT_PACKAGE_VERSION */

View File

@@ -0,0 +1,25 @@
{-# LANGUAGE NoRebindableSyntax #-}
{-# OPTIONS_GHC -fno-warn-missing-import-lists #-}
{-# OPTIONS_GHC -w #-}
module PackageInfo_pcc_haskell (
name,
version,
synopsis,
copyright,
homepage,
) where
import Data.Version (Version(..))
import Prelude
name :: String
name = "pcc_haskell"
version :: Version
version = Version [0,1,0,0] []
synopsis :: String
synopsis = ""
copyright :: String
copyright = "2024 Author name here"
homepage :: String
homepage = "https://github.com/githubuser/pcc-haskell#readme"

View File

@@ -0,0 +1,77 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE NoRebindableSyntax #-}
#if __GLASGOW_HASKELL__ >= 810
{-# OPTIONS_GHC -Wno-prepositive-qualified-module #-}
#endif
{-# OPTIONS_GHC -fno-warn-missing-import-lists #-}
{-# OPTIONS_GHC -w #-}
module Paths_pcc_haskell (
version,
getBinDir, getLibDir, getDynLibDir, getDataDir, getLibexecDir,
getDataFileName, getSysconfDir
) where
import qualified Control.Exception as Exception
import qualified Data.List as List
import Data.Version (Version(..))
import System.Environment (getEnv)
import Prelude
#if defined(VERSION_base)
#if MIN_VERSION_base(4,0,0)
catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a
#else
catchIO :: IO a -> (Exception.Exception -> IO a) -> IO a
#endif
#else
catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a
#endif
catchIO = Exception.catch
version :: Version
version = Version [0,1,0,0] []
getDataFileName :: FilePath -> IO FilePath
getDataFileName name = do
dir <- getDataDir
return (dir `joinFileName` name)
getBinDir, getLibDir, getDynLibDir, getDataDir, getLibexecDir, getSysconfDir :: IO FilePath
bindir, libdir, dynlibdir, datadir, libexecdir, sysconfdir :: FilePath
bindir = "/home/maxime/source/PolyCubeCounting/haskell/.stack-work/install/x86_64-linux/75fd8e4951838cd19ff034f1d6b677ab2be4fb856638520103bae2e94ff9d516/9.6.4/bin"
libdir = "/home/maxime/source/PolyCubeCounting/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-3uXeFg0wTKK8h95Bv99PsP-pcc-haskell-exe"
dynlibdir = "/home/maxime/source/PolyCubeCounting/haskell/.stack-work/install/x86_64-linux/75fd8e4951838cd19ff034f1d6b677ab2be4fb856638520103bae2e94ff9d516/9.6.4/lib/x86_64-linux-ghc-9.6.4"
datadir = "/home/maxime/source/PolyCubeCounting/haskell/.stack-work/install/x86_64-linux/75fd8e4951838cd19ff034f1d6b677ab2be4fb856638520103bae2e94ff9d516/9.6.4/share/x86_64-linux-ghc-9.6.4/pcc-haskell-0.1.0.0"
libexecdir = "/home/maxime/source/PolyCubeCounting/haskell/.stack-work/install/x86_64-linux/75fd8e4951838cd19ff034f1d6b677ab2be4fb856638520103bae2e94ff9d516/9.6.4/libexec/x86_64-linux-ghc-9.6.4/pcc-haskell-0.1.0.0"
sysconfdir = "/home/maxime/source/PolyCubeCounting/haskell/.stack-work/install/x86_64-linux/75fd8e4951838cd19ff034f1d6b677ab2be4fb856638520103bae2e94ff9d516/9.6.4/etc"
getBinDir = catchIO (getEnv "pcc_haskell_bindir") (\_ -> return bindir)
getLibDir = catchIO (getEnv "pcc_haskell_libdir") (\_ -> return libdir)
getDynLibDir = catchIO (getEnv "pcc_haskell_dynlibdir") (\_ -> return dynlibdir)
getDataDir = catchIO (getEnv "pcc_haskell_datadir") (\_ -> return datadir)
getLibexecDir = catchIO (getEnv "pcc_haskell_libexecdir") (\_ -> return libexecdir)
getSysconfDir = catchIO (getEnv "pcc_haskell_sysconfdir") (\_ -> return sysconfdir)
joinFileName :: String -> String -> FilePath
joinFileName "" fname = fname
joinFileName "." fname = fname
joinFileName dir "" = dir
joinFileName dir fname
| isPathSeparator (List.last dir) = dir ++ fname
| otherwise = dir ++ pathSeparator : fname
pathSeparator :: Char
pathSeparator = '/'
isPathSeparator :: Char -> Bool
isPathSeparator c = c == '/'

View File

@@ -0,0 +1,150 @@
/* DO NOT EDIT: This file is automatically generated by Cabal */
/* package pcc-haskell-0.1.0.0 */
#ifndef VERSION_pcc_haskell
#define VERSION_pcc_haskell "0.1.0.0"
#endif /* VERSION_pcc_haskell */
#ifndef MIN_VERSION_pcc_haskell
#define MIN_VERSION_pcc_haskell(major1,major2,minor) (\
(major1) < 0 || \
(major1) == 0 && (major2) < 1 || \
(major1) == 0 && (major2) == 1 && (minor) <= 0)
#endif /* MIN_VERSION_pcc_haskell */
/* package base-4.18.2.0 */
#ifndef VERSION_base
#define VERSION_base "4.18.2.0"
#endif /* VERSION_base */
#ifndef MIN_VERSION_base
#define MIN_VERSION_base(major1,major2,minor) (\
(major1) < 4 || \
(major1) == 4 && (major2) < 18 || \
(major1) == 4 && (major2) == 18 && (minor) <= 2)
#endif /* MIN_VERSION_base */
/* package combinatorial-0.1.1 */
#ifndef VERSION_combinatorial
#define VERSION_combinatorial "0.1.1"
#endif /* VERSION_combinatorial */
#ifndef MIN_VERSION_combinatorial
#define MIN_VERSION_combinatorial(major1,major2,minor) (\
(major1) < 0 || \
(major1) == 0 && (major2) < 1 || \
(major1) == 0 && (major2) == 1 && (minor) <= 1)
#endif /* MIN_VERSION_combinatorial */
/* package pcc-haskell-0.1.0.0 */
#ifndef VERSION_pcc_haskell
#define VERSION_pcc_haskell "0.1.0.0"
#endif /* VERSION_pcc_haskell */
#ifndef MIN_VERSION_pcc_haskell
#define MIN_VERSION_pcc_haskell(major1,major2,minor) (\
(major1) < 0 || \
(major1) == 0 && (major2) < 1 || \
(major1) == 0 && (major2) == 1 && (minor) <= 0)
#endif /* MIN_VERSION_pcc_haskell */
/* package unordered-containers-0.2.20 */
#ifndef VERSION_unordered_containers
#define VERSION_unordered_containers "0.2.20"
#endif /* VERSION_unordered_containers */
#ifndef MIN_VERSION_unordered_containers
#define MIN_VERSION_unordered_containers(major1,major2,minor) (\
(major1) < 0 || \
(major1) == 0 && (major2) < 2 || \
(major1) == 0 && (major2) == 2 && (minor) <= 20)
#endif /* MIN_VERSION_unordered_containers */
/* tool gcc-11 */
#ifndef TOOL_VERSION_gcc
#define TOOL_VERSION_gcc "11"
#endif /* TOOL_VERSION_gcc */
#ifndef MIN_TOOL_VERSION_gcc
#define MIN_TOOL_VERSION_gcc(major1,major2,minor) (\
(major1) < 11 || \
(major1) == 11 && (major2) < 0 || \
(major1) == 11 && (major2) == 0 && (minor) <= 0)
#endif /* MIN_TOOL_VERSION_gcc */
/* tool ghc-9.6.4 */
#ifndef TOOL_VERSION_ghc
#define TOOL_VERSION_ghc "9.6.4"
#endif /* TOOL_VERSION_ghc */
#ifndef MIN_TOOL_VERSION_ghc
#define MIN_TOOL_VERSION_ghc(major1,major2,minor) (\
(major1) < 9 || \
(major1) == 9 && (major2) < 6 || \
(major1) == 9 && (major2) == 6 && (minor) <= 4)
#endif /* MIN_TOOL_VERSION_ghc */
/* tool ghc-pkg-9.6.4 */
#ifndef TOOL_VERSION_ghc_pkg
#define TOOL_VERSION_ghc_pkg "9.6.4"
#endif /* TOOL_VERSION_ghc_pkg */
#ifndef MIN_TOOL_VERSION_ghc_pkg
#define MIN_TOOL_VERSION_ghc_pkg(major1,major2,minor) (\
(major1) < 9 || \
(major1) == 9 && (major2) < 6 || \
(major1) == 9 && (major2) == 6 && (minor) <= 4)
#endif /* MIN_TOOL_VERSION_ghc_pkg */
/* tool haddock-2.29.2 */
#ifndef TOOL_VERSION_haddock
#define TOOL_VERSION_haddock "2.29.2"
#endif /* TOOL_VERSION_haddock */
#ifndef MIN_TOOL_VERSION_haddock
#define MIN_TOOL_VERSION_haddock(major1,major2,minor) (\
(major1) < 2 || \
(major1) == 2 && (major2) < 29 || \
(major1) == 2 && (major2) == 29 && (minor) <= 2)
#endif /* MIN_TOOL_VERSION_haddock */
/* tool hpc-0.68 */
#ifndef TOOL_VERSION_hpc
#define TOOL_VERSION_hpc "0.68"
#endif /* TOOL_VERSION_hpc */
#ifndef MIN_TOOL_VERSION_hpc
#define MIN_TOOL_VERSION_hpc(major1,major2,minor) (\
(major1) < 0 || \
(major1) == 0 && (major2) < 68 || \
(major1) == 0 && (major2) == 68 && (minor) <= 0)
#endif /* MIN_TOOL_VERSION_hpc */
/* tool hsc2hs-0.68.9 */
#ifndef TOOL_VERSION_hsc2hs
#define TOOL_VERSION_hsc2hs "0.68.9"
#endif /* TOOL_VERSION_hsc2hs */
#ifndef MIN_TOOL_VERSION_hsc2hs
#define MIN_TOOL_VERSION_hsc2hs(major1,major2,minor) (\
(major1) < 0 || \
(major1) == 0 && (major2) < 68 || \
(major1) == 0 && (major2) == 68 && (minor) <= 9)
#endif /* MIN_TOOL_VERSION_hsc2hs */
/* tool pkg-config-0.29.2 */
#ifndef TOOL_VERSION_pkg_config
#define TOOL_VERSION_pkg_config "0.29.2"
#endif /* TOOL_VERSION_pkg_config */
#ifndef MIN_TOOL_VERSION_pkg_config
#define MIN_TOOL_VERSION_pkg_config(major1,major2,minor) (\
(major1) < 0 || \
(major1) == 0 && (major2) < 29 || \
(major1) == 0 && (major2) == 29 && (minor) <= 2)
#endif /* MIN_TOOL_VERSION_pkg_config */
/* tool runghc-9.6.4 */
#ifndef TOOL_VERSION_runghc
#define TOOL_VERSION_runghc "9.6.4"
#endif /* TOOL_VERSION_runghc */
#ifndef MIN_TOOL_VERSION_runghc
#define MIN_TOOL_VERSION_runghc(major1,major2,minor) (\
(major1) < 9 || \
(major1) == 9 && (major2) < 6 || \
(major1) == 9 && (major2) == 6 && (minor) <= 4)
#endif /* MIN_TOOL_VERSION_runghc */
/* tool strip-2.38 */
#ifndef TOOL_VERSION_strip
#define TOOL_VERSION_strip "2.38"
#endif /* TOOL_VERSION_strip */
#ifndef MIN_TOOL_VERSION_strip
#define MIN_TOOL_VERSION_strip(major1,major2,minor) (\
(major1) < 2 || \
(major1) == 2 && (major2) < 38 || \
(major1) == 2 && (major2) == 38 && (minor) <= 0)
#endif /* MIN_TOOL_VERSION_strip */
#ifndef CURRENT_COMPONENT_ID
#define CURRENT_COMPONENT_ID "pcc-haskell-0.1.0.0-3uXeFg0wTKK8h95Bv99PsP-pcc-haskell-exe"
#endif /* CURRENT_COMPONENT_ID */
#ifndef CURRENT_PACKAGE_VERSION
#define CURRENT_PACKAGE_VERSION "0.1.0.0"
#endif /* CURRENT_PACKAGE_VERSION */

View File

@@ -0,0 +1,37 @@
name: pcc-haskell
version: 0.1.0.0
visibility: public
id: pcc-haskell-0.1.0.0-6K1H0wLq681LrfvIdKcNTn
key: pcc-haskell-0.1.0.0-6K1H0wLq681LrfvIdKcNTn
license: BSD-3-Clause
copyright: 2024 Author name here
maintainer: example@example.com
author: Author name here
homepage: https://github.com/githubuser/pcc-haskell#readme
description:
Please see the README on GitHub at <https://github.com/githubuser/pcc-haskell#readme>
abi: inplace
exposed: True
exposed-modules: PolyCube
hidden-modules: Paths_pcc_haskell
import-dirs:
/home/maxime/source/PolyCubeCounting/haskell/.stack-work/dist/x86_64-linux/ghc-9.6.4/build
library-dirs:
/home/maxime/source/PolyCubeCounting/haskell/.stack-work/dist/x86_64-linux/ghc-9.6.4/build
library-dirs-static:
/home/maxime/source/PolyCubeCounting/haskell/.stack-work/dist/x86_64-linux/ghc-9.6.4/build
dynamic-library-dirs:
/home/maxime/source/PolyCubeCounting/haskell/.stack-work/dist/x86_64-linux/ghc-9.6.4/build
data-dir: /home/maxime/source/PolyCubeCounting/haskell/.
hs-libraries: HSpcc-haskell-0.1.0.0-6K1H0wLq681LrfvIdKcNTn
depends: base-4.18.2.0 hashable-1.4.3.0-6LukcPsaWSn5ctNZbuwjol
haddock-interfaces:
/home/maxime/source/PolyCubeCounting/haskell/.stack-work/dist/x86_64-linux/ghc-9.6.4/doc/html/pcc-haskell/pcc-haskell.haddock
haddock-html:
/home/maxime/source/PolyCubeCounting/haskell/.stack-work/dist/x86_64-linux/ghc-9.6.4/doc/html/pcc-haskell

Binary file not shown.

View File

@@ -0,0 +1,18 @@
/home/maxime/.ghcup/ghc/9.6.4/lib/ghc-9.6.4/lib/x86_64-linux-ghc-9.6.4/rts-1.0.2/include/ghcversion.h:
hash: cbc0ab805e5b827180e3116cecd3f6665988df7f45a6b64f0e09ea8c25c438ff
? /home/maxime/source/PolyCubeCounting/haskell/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/pcc-haskell-exe/autogen/Paths_pcc_haskell.hs
: hash: 8a02db6645f06300b4483de43f30b6b93c5812f75ff87a0d1e58e39b3aa0b5a4
? /home/maxime/source/PolyCubeCounting/haskell/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/pcc-haskell-exe/autogen/cabal_macros.h
: hash: 81caa4b570e60a5198a6a2692dab8386b3a0573d2f434c440e4a0608f6d45ced
/home/maxime/source/PolyCubeCounting/haskell/CHANGELOG.md:
hash: 28635dd6cd72c05dc6d925c4f9a90594ecd1d49f800237407f3f022c515c0e7b
/home/maxime/source/PolyCubeCounting/haskell/README.md:
hash: 7977cc588f7e4331316835e35589dc4ac1b6579bb1ddb004793d0f7ab27f23fe
/home/maxime/source/PolyCubeCounting/haskell/app/Main.hs:
hash: 39b9c05ce23c04f5f4fc25ae75ec53770148267f79303f8d4e60e25a17e1e4b0
/home/maxime/source/PolyCubeCounting/haskell/package.yaml:
hash: eab634f7eb24459df2c4898a07904dbd87c46dae3c8b758755745fac6fbfec48
/home/maxime/source/PolyCubeCounting/haskell/pcc-haskell.cabal:
hash: d44a183437e28c5c6176283f89ff9373ef74713e12ca2115be0b160ba2cc2ba0
/usr/include/stdc-predef.h:
hash: cb08cd5d4cc059a90833ac48a284d25016e8d56ded8ad4cd98d8ac59cc5053f3

View File

@@ -0,0 +1,18 @@
/home/maxime/.ghcup/ghc/9.6.4/lib/ghc-9.6.4/lib/x86_64-linux-ghc-9.6.4/rts-1.0.2/include/ghcversion.h:
hash: cbc0ab805e5b827180e3116cecd3f6665988df7f45a6b64f0e09ea8c25c438ff
/home/maxime/source/PolyCubeCounting/haskell/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/autogen/Paths_pcc_haskell.hs:
hash: abb5e685752e098f752630b458c918261b6f2b9d32b5289292cdfe9062f954a6
/home/maxime/source/PolyCubeCounting/haskell/.stack-work/dist/x86_64-linux/ghc-9.6.4/build/autogen/cabal_macros.h:
hash: 8767f2e923ac04329c60e5bcca6dda7d919593eb386ab95c2ce5b3e3053e8be2
/home/maxime/source/PolyCubeCounting/haskell/CHANGELOG.md:
hash: 28635dd6cd72c05dc6d925c4f9a90594ecd1d49f800237407f3f022c515c0e7b
/home/maxime/source/PolyCubeCounting/haskell/README.md:
hash: 7977cc588f7e4331316835e35589dc4ac1b6579bb1ddb004793d0f7ab27f23fe
/home/maxime/source/PolyCubeCounting/haskell/package.yaml:
hash: eab634f7eb24459df2c4898a07904dbd87c46dae3c8b758755745fac6fbfec48
/home/maxime/source/PolyCubeCounting/haskell/pcc-haskell.cabal:
hash: d44a183437e28c5c6176283f89ff9373ef74713e12ca2115be0b160ba2cc2ba0
/home/maxime/source/PolyCubeCounting/haskell/src/PolyCube.hs:
hash: 771d981c0ac1035b15f83a5ac149206ed0bdd11669c6266e29c798babdfc8cda
/usr/include/stdc-predef.h:
hash: cb08cd5d4cc059a90833ac48a284d25016e8d56ded8ad4cd98d8ac59cc5053f3

View File

@@ -0,0 +1 @@
Just used for its modification time

View File

@@ -0,0 +1 @@
/home/maxime/source/PolyCubeCounting/haskell/

View File

@@ -0,0 +1 @@
Just used for its modification time

View File

@@ -0,0 +1,30 @@
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.

View File

@@ -0,0 +1,39 @@
name: pcc-haskell
version: 0.1.0.0
visibility: public
id: pcc-haskell-0.1.0.0-6K1H0wLq681LrfvIdKcNTn
key: pcc-haskell-0.1.0.0-6K1H0wLq681LrfvIdKcNTn
license: BSD-3-Clause
copyright: 2024 Author name here
maintainer: example@example.com
author: Author name here
homepage: https://github.com/githubuser/pcc-haskell#readme
description:
Please see the README on GitHub at <https://github.com/githubuser/pcc-haskell#readme>
abi: ad41668bfb3a23f3629526ea3a62f83f
exposed: True
exposed-modules: PolyCube
hidden-modules: Paths_pcc_haskell
import-dirs:
/home/maxime/source/PolyCubeCounting/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
library-dirs:
/home/maxime/source/PolyCubeCounting/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
library-dirs-static:
/home/maxime/source/PolyCubeCounting/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
dynamic-library-dirs:
/home/maxime/source/PolyCubeCounting/haskell/.stack-work/install/x86_64-linux/75fd8e4951838cd19ff034f1d6b677ab2be4fb856638520103bae2e94ff9d516/9.6.4/lib/x86_64-linux-ghc-9.6.4
data-dir:
/home/maxime/source/PolyCubeCounting/haskell/.stack-work/install/x86_64-linux/75fd8e4951838cd19ff034f1d6b677ab2be4fb856638520103bae2e94ff9d516/9.6.4/share/x86_64-linux-ghc-9.6.4/pcc-haskell-0.1.0.0
hs-libraries: HSpcc-haskell-0.1.0.0-6K1H0wLq681LrfvIdKcNTn
depends: base-4.18.2.0 hashable-1.4.3.0-6LukcPsaWSn5ctNZbuwjol
haddock-interfaces:
/home/maxime/source/PolyCubeCounting/haskell/.stack-work/install/x86_64-linux/75fd8e4951838cd19ff034f1d6b677ab2be4fb856638520103bae2e94ff9d516/9.6.4/doc/pcc-haskell-0.1.0.0/pcc-haskell.haddock
haddock-html:
/home/maxime/source/PolyCubeCounting/haskell/.stack-work/install/x86_64-linux/75fd8e4951838cd19ff034f1d6b677ab2be4fb856638520103bae2e94ff9d516/9.6.4/doc/pcc-haskell-0.1.0.0

Binary file not shown.

View File

@@ -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

1
haskell/count.out Normal file
View File

@@ -0,0 +1 @@
[1]

View File

@@ -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

View File

@@ -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

View File

@@ -1,6 +0,0 @@
module Lib
( someFunc
) where
someFunc :: IO ()
someFunc = putStrLn "someFunc"

78
haskell/src/PolyCube.hs Normal file
View File

@@ -0,0 +1,78 @@
{-# LANGUAGE DeriveGeneric #-}
module PolyCube (
Coord3D (..),
Offset3D (..),
PolyCube (..),
getOffsets,
applyOffset,
diff,
rotateCubes
) where
import Prelude hiding (flip)
import GHC.Generics (Generic)
import Data.Hashable (Hashable)
newtype Coord3D = Coord3D (Int, Int, Int)
deriving (
Show,
Eq,
Generic,
Ord
)
instance Hashable Coord3D
newtype Offset3D = Offset3D (Int, Int, Int)
deriving (
Show,
Eq,
Generic,
Ord
)
instance Hashable Offset3D
data PolyCube = PolyCube {
orientations :: [[Coord3D]],
lastAdded :: [Coord3D],
size :: Int
} deriving (
Show,
Eq
)
getOffsets :: [Coord3D] -> [Offset3D]
getOffsets [] = error "empty List"
getOffsets [_] = []
getOffsets (x:y:xs) = diff x y:getOffsets (y:xs)
diff :: Coord3D -> Coord3D -> Offset3D
diff (Coord3D (a, b, c)) (Coord3D (x, y, z)) = Offset3D (x-a, y-b, z-c)
applyOffset :: Coord3D -> Offset3D -> Coord3D
applyOffset (Coord3D (a, b, c)) (Offset3D (x, y, z)) = Coord3D (a+x, b+y, c+z)
rotateCubes :: [Coord3D] -> Int -> [Coord3D]
rotateCubes tree n = map (invert . flip . rotate n) tree where
rotate :: Int -> Coord3D -> (Int, (Int, Int, Int))
rotate i (Coord3D (a, b, c)) = case mod i 3 of
0 -> (j, (a, b, c))
1 -> (j, (b, c, a))
2 -> (j, (c, a, b))
_ -> (j, (a, b, c))
where
j = div i 3
flip :: (Int, (Int, Int, Int)) -> (Int, (Int, Int, Int))
flip (i, (a, b, c)) = case mod i 4 of
0 -> (j, (a, b, c))
1 -> (j, (a, -b, -c))
2 -> (j, (-a, b, -c))
3 -> (j, (-a, -b, c))
_ -> (j, (a, b, c))
where
j = div i 4
invert :: (Int, (Int, Int, Int)) -> Coord3D
invert (i, (a, b, c)) = case mod i 2 of
0 -> Coord3D (a, b, c)
1 -> Coord3D (-c, -b, -a)
_ -> Coord3D (a, b, c)

View File

@@ -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

13
haskell/stack.yaml.lock Normal file
View File

@@ -0,0 +1,13 @@
# This file was autogenerated by Stack.
# You should not edit this file by hand.
# For more information, please see the documentation at:
# https://docs.haskellstack.org/en/stable/lock_files
packages: []
snapshots:
- completed:
sha256: 2fdd7d3e54540062ef75ca0a73ca3a804c527dbf8a4cadafabf340e66ac4af40
size: 712469
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/22/11.yaml
original:
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/22/11.yaml

View File

@@ -1,2 +1,3 @@
main :: IO ()
main = putStrLn "Test suite not yet implemented"