clean exec
This commit is contained in:
parent
f5b248dadc
commit
30b9ea0217
4 changed files with 19 additions and 10 deletions
|
@ -28,7 +28,6 @@ library
|
||||||
hs-source-dirs:
|
hs-source-dirs:
|
||||||
src
|
src
|
||||||
exposed-modules:
|
exposed-modules:
|
||||||
Lib
|
|
||||||
Day1
|
Day1
|
||||||
other-modules:
|
other-modules:
|
||||||
Paths_adventofcode
|
Paths_adventofcode
|
||||||
|
@ -45,6 +44,8 @@ executable adventofcode-exe
|
||||||
build-depends:
|
build-depends:
|
||||||
base
|
base
|
||||||
, adventofcode
|
, adventofcode
|
||||||
|
, protolude
|
||||||
|
, pretty
|
||||||
default-language: Haskell2010
|
default-language: Haskell2010
|
||||||
|
|
||||||
test-suite adventofcode-test
|
test-suite adventofcode-test
|
||||||
|
|
17
app/Main.hs
17
app/Main.hs
|
@ -1,6 +1,19 @@
|
||||||
|
{-# LANGUAGE NoImplicitPrelude #-}
|
||||||
|
{-# LANGUAGE OverloadedStrings #-}
|
||||||
module Main where
|
module Main where
|
||||||
|
|
||||||
import Lib
|
import Protolude
|
||||||
|
import Text.PrettyPrint hiding ((<>))
|
||||||
|
|
||||||
|
import qualified Day1
|
||||||
|
|
||||||
|
showSol :: [Char] -> Doc -> IO ()
|
||||||
|
showSol txt d = putText . toS . render $
|
||||||
|
text (" " <> txt <> ":")
|
||||||
|
<+> d
|
||||||
|
|
||||||
main :: IO ()
|
main :: IO ()
|
||||||
main = someFunc
|
main = do
|
||||||
|
putText "Day 1:"
|
||||||
|
showSol "Solution 1" (int (Day1.solution1 Day1.ex1code))
|
||||||
|
showSol "Solution 2" (int (Day1.solution2 Day1.ex1code))
|
||||||
|
|
|
@ -13,7 +13,6 @@ extra-source-files:
|
||||||
library:
|
library:
|
||||||
source-dirs: src
|
source-dirs: src
|
||||||
exposed-modules:
|
exposed-modules:
|
||||||
- Lib
|
|
||||||
- Day1
|
- Day1
|
||||||
dependencies:
|
dependencies:
|
||||||
- base >=4.7 && <5
|
- base >=4.7 && <5
|
||||||
|
@ -29,6 +28,8 @@ executables:
|
||||||
dependencies:
|
dependencies:
|
||||||
- base
|
- base
|
||||||
- adventofcode
|
- adventofcode
|
||||||
|
- protolude
|
||||||
|
- pretty
|
||||||
tests:
|
tests:
|
||||||
adventofcode-test:
|
adventofcode-test:
|
||||||
main: Spec.hs
|
main: Spec.hs
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
module Lib
|
|
||||||
( someFunc
|
|
||||||
) where
|
|
||||||
|
|
||||||
someFunc :: IO ()
|
|
||||||
someFunc = putStrLn "someFunc"
|
|
Loading…
Reference in a new issue