--- /dev/null
+cabal-version: 3.4
+name: adventofcode24
+version: 0.1.0.0
+-- synopsis:
+-- description:
+license: GPL-3.0-or-later
+license-file: LICENSE
+author: Neil Smith
+maintainer: NeilNjae@users.noreply.github.com
+-- copyright:
+category: Game
+build-type: Simple
+extra-doc-files: CHANGELOG.md
+-- extra-source-files:
+
+common warnings
+ ghc-options: -Wall
+
+common common-extensions
+ default-extensions: AllowAmbiguousTypes
+ , ApplicativeDo
+ , BlockArguments
+ -- , DuplicateRecordFields
+ , FunctionalDependencies
+ -- , ImplicitParams
+ , MultiWayIf
+ , NegativeLiterals
+ , NumDecimals
+ -- , NoFieldSelectors
+ , OverloadedLists
+ -- , OverloadedRecordDot
+ , OverloadedStrings
+ -- , PartialTypeSignatures
+ , PatternSynonyms
+ , RecordWildCards
+ , TemplateHaskell
+ -- , TransformListComp
+ , TypeFamilies
+ , ViewPatterns
+
+common build-directives
+ build-depends: base >=4.19
+ default-language: GHC2021
+ hs-source-dirs: ., app, src
+ -- other-modules: AoC
+ ghc-options: -O2
+ -Wall
+ -threaded
+ -rtsopts "-with-rtsopts=-N"
+
+library
+ import: warnings, common-extensions
+ exposed-modules: AoC
+ -- other-modules:
+ -- other-extensions:
+ build-depends: base ^>=4.19.1.0
+ hs-source-dirs: src
+ default-language: GHC2021
+
+executable adventofcode24
+ import: warnings
+ main-is: Main.hs
+ -- other-modules:
+ -- other-extensions:
+ build-depends:
+ base ^>=4.19.1.0,
+ adventofcode24
+
+ hs-source-dirs: app
+ default-language: GHC2021
+
+executable advent01
+ import: common-extensions, build-directives
+ main-is: advent01/Main.hs
+-- build-depends: split
--- /dev/null
+Module AoC ( getDataFileName ) where
+
+import System.Environment
+
+getDataFileName :: IO String
+getDataFileName =
+ do args <- getArgs
+ progName <- getProgName
+ let baseDataName = if null args
+ then progName
+ else head args
+ let baseDataName' = if length baseDataName < 5
+ then progName ++ baseDataName
+ else baseDataName
+ let dataFileName = "../data/" ++ baseDataName' ++ ".txt"
+ return dataFileName