haskell: 2023 cabal

This commit is contained in:
Maciej Jur 2023-11-29 22:58:49 +01:00
parent e28474f762
commit a3cb755db2
Signed by: kamov
GPG key ID: 191CBFF5F72ECAFD
4 changed files with 22 additions and 5 deletions

View file

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

View file

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

View file

@ -1,4 +1,5 @@
module Day01 (someFunc) where
someFunc :: IO ()
someFunc = putStrLn "someFunc"
someFunc = putStrLn "someFunc22"