haskell: 2023 cabal
This commit is contained in:
parent
e28474f762
commit
a3cb755db2
|
@ -85,7 +85,8 @@ executable aoc2023
|
||||||
main-is: Main.hs
|
main-is: Main.hs
|
||||||
|
|
||||||
-- Modules included in this executable, other than Main.
|
-- Modules included in this executable, other than Main.
|
||||||
-- other-modules:
|
other-modules:
|
||||||
|
Utils
|
||||||
|
|
||||||
-- LANGUAGE extensions used by modules in this package.
|
-- LANGUAGE extensions used by modules in this package.
|
||||||
-- other-extensions:
|
-- other-extensions:
|
||||||
|
@ -93,6 +94,7 @@ executable aoc2023
|
||||||
-- Other library packages from which modules are imported.
|
-- Other library packages from which modules are imported.
|
||||||
build-depends:
|
build-depends:
|
||||||
base ^>=4.17.2.0,
|
base ^>=4.17.2.0,
|
||||||
|
text ^>=2.1,
|
||||||
aoc2023
|
aoc2023
|
||||||
|
|
||||||
-- Directories containing source files.
|
-- Directories containing source files.
|
||||||
|
|
|
@ -1,8 +1,12 @@
|
||||||
module Main where
|
module Main where
|
||||||
|
|
||||||
import qualified Day01 (someFunc)
|
import qualified Data.Text as T
|
||||||
|
import Utils (readInput)
|
||||||
|
|
||||||
|
import qualified Day01
|
||||||
|
import qualified Day02
|
||||||
|
|
||||||
main :: IO ()
|
main :: IO ()
|
||||||
main = do
|
main = do
|
||||||
putStrLn "Hello, Haskell!"
|
text <- readInput 1
|
||||||
MyLib.someFunc
|
putStrLn $ T.unpack text
|
||||||
|
|
10
2023/haskell/app/Utils.hs
Normal file
10
2023/haskell/app/Utils.hs
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
module Utils (readInput) where
|
||||||
|
|
||||||
|
import Prelude hiding (readFile)
|
||||||
|
import Text.Printf (printf)
|
||||||
|
import qualified Data.Text as T
|
||||||
|
import Data.Text.IO (readFile)
|
||||||
|
|
||||||
|
|
||||||
|
readInput :: Int -> IO T.Text
|
||||||
|
readInput = readFile . printf "../.inputs/%02d"
|
|
@ -1,4 +1,5 @@
|
||||||
module Day01 (someFunc) where
|
module Day01 (someFunc) where
|
||||||
|
|
||||||
someFunc :: IO ()
|
someFunc :: IO ()
|
||||||
someFunc = putStrLn "someFunc"
|
someFunc = putStrLn "someFunc22"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue