From 30b9ea0217e487755df055b7b09b5e989da1c3d2 Mon Sep 17 00:00:00 2001 From: "Yann Esposito (Yogsototh)" Date: Sat, 2 Dec 2017 00:27:43 +0100 Subject: [PATCH] clean exec --- adventofcode.cabal | 3 ++- app/Main.hs | 17 +++++++++++++++-- package.yaml | 3 ++- src/Lib.hs | 6 ------ 4 files changed, 19 insertions(+), 10 deletions(-) delete mode 100644 src/Lib.hs diff --git a/adventofcode.cabal b/adventofcode.cabal index 17d8d12..af61cda 100644 --- a/adventofcode.cabal +++ b/adventofcode.cabal @@ -28,7 +28,6 @@ library hs-source-dirs: src exposed-modules: - Lib Day1 other-modules: Paths_adventofcode @@ -45,6 +44,8 @@ executable adventofcode-exe build-depends: base , adventofcode + , protolude + , pretty default-language: Haskell2010 test-suite adventofcode-test diff --git a/app/Main.hs b/app/Main.hs index de1c1ab..f008dd6 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -1,6 +1,19 @@ +{-# LANGUAGE NoImplicitPrelude #-} +{-# LANGUAGE OverloadedStrings #-} 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 = someFunc +main = do + putText "Day 1:" + showSol "Solution 1" (int (Day1.solution1 Day1.ex1code)) + showSol "Solution 2" (int (Day1.solution2 Day1.ex1code)) diff --git a/package.yaml b/package.yaml index eb43b78..708f8a7 100644 --- a/package.yaml +++ b/package.yaml @@ -13,7 +13,6 @@ extra-source-files: library: source-dirs: src exposed-modules: - - Lib - Day1 dependencies: - base >=4.7 && <5 @@ -29,6 +28,8 @@ executables: dependencies: - base - adventofcode + - protolude + - pretty tests: adventofcode-test: main: Spec.hs diff --git a/src/Lib.hs b/src/Lib.hs deleted file mode 100644 index d36ff27..0000000 --- a/src/Lib.hs +++ /dev/null @@ -1,6 +0,0 @@ -module Lib - ( someFunc - ) where - -someFunc :: IO () -someFunc = putStrLn "someFunc"