haskell: 2023 cabal
This commit is contained in:
parent
e28474f762
commit
a3cb755db2
|
@ -85,7 +85,8 @@ executable aoc2023
|
|||
main-is: Main.hs
|
||||
|
||||
-- Modules included in this executable, other than Main.
|
||||
-- other-modules:
|
||||
other-modules:
|
||||
Utils
|
||||
|
||||
-- LANGUAGE extensions used by modules in this package.
|
||||
-- other-extensions:
|
||||
|
@ -93,6 +94,7 @@ executable aoc2023
|
|||
-- Other library packages from which modules are imported.
|
||||
build-depends:
|
||||
base ^>=4.17.2.0,
|
||||
text ^>=2.1,
|
||||
aoc2023
|
||||
|
||||
-- Directories containing source files.
|
||||
|
|
|
@ -1,8 +1,12 @@
|
|||
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 = do
|
||||
putStrLn "Hello, Haskell!"
|
||||
MyLib.someFunc
|
||||
text <- readInput 1
|
||||
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
|
||||
|
||||
someFunc :: IO ()
|
||||
someFunc = putStrLn "someFunc"
|
||||
someFunc = putStrLn "someFunc22"
|
||||
|
||||
|
|
Loading…
Reference in a new issue