Skip to content

Commit

Permalink
work for ghc 8.8 as well
Browse files Browse the repository at this point in the history
  • Loading branch information
mstksg committed Nov 22, 2021
1 parent 00ea4ec commit 842d8dd
Show file tree
Hide file tree
Showing 8 changed files with 157 additions and 240 deletions.
311 changes: 103 additions & 208 deletions aoc-dev.cabal
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
cabal-version: 1.12

-- This file has been generated from package.yaml by hpack version 0.34.4.
--
-- see: https://github.com/sol/hpack
--
-- hash: caed1f3774882334941126e63efa05febf1972dc0df0ec4db89d88b0eea3ba5f

cabal-version: 2.4
name: aoc-dev
version: 0.1.0.0
synopsis: Development environment for Advent of Code challenges
Expand All @@ -17,19 +10,109 @@ homepage: https://github.com/mstksg/advent-of-code-dev#readme
bug-reports: https://github.com/mstksg/advent-of-code-dev/issues
author: Justin Le
maintainer: [email protected]
copyright: (c) Justin Le 2018
license: BSD3
copyright: (c) Justin Le 2021
license: MIT
license-file: LICENSE
build-type: Simple
extra-source-files:
README.md
CHANGELOG.md

source-repository head
type: git
location: https://github.com/mstksg/advent-of-code-dev
type: git
location: https://github.com/mstksg/advent-of-code-dev.git

common common-options
build-depends: advent-of-code-api >=0.2.7
, aeson
, ansi-terminal
, base >=4.7 && <5
, bytestring
, containers
, criterion
, data-default-class
, deepseq
, directory
, filepath
, finite-typelits
, haskeline
, haskell-names
, Cabal
, haskell-src-exts
, hpack
, megaparsec
, microlens-th
, mtl
, pandoc
, parser-combinators
, profunctors
, template-haskell
, text
, th-abstraction
, time
, transformers
, yaml

ghc-options: -Wall
-Wcompat
-Widentities
-Wincomplete-uni-patterns
-Wincomplete-record-updates
-Wno-partial-type-signatures
if impl(ghc >= 8.0)
ghc-options: -Wredundant-constraints
if impl(ghc >= 8.2)
ghc-options: -fhide-source-paths
if impl(ghc >= 8.4)
ghc-options: -Wmissing-export-lists
-Wpartial-fields
if impl(ghc >= 8.8)
ghc-options: -Wmissing-deriving-strategies

default-language: Haskell2010
default-extensions:
AllowAmbiguousTypes
ApplicativeDo
BangPatterns
BlockArguments
DataKinds
DeriveFoldable
DeriveFunctor
DeriveGeneric
DeriveTraversable
DerivingStrategies
EmptyCase
FlexibleContexts
FlexibleInstances
FunctionalDependencies
GADTs
GeneralizedNewtypeDeriving
ImplicitParams
KindSignatures
LambdaCase
MonadComprehensions
MultiParamTypeClasses
MultiWayIf
NumDecimals
OverloadedLabels
PartialTypeSignatures
PatternGuards
PatternSynonyms
PolyKinds
RankNTypes
RecordWildCards
ScopedTypeVariables
StandaloneDeriving
TemplateHaskell
TupleSections
TypeApplications
TypeInType
TypeOperators
UndecidableInstances
ViewPatterns

library
import: common-options
exposed-modules:
AOC
AOC.Challenge
Expand Down Expand Up @@ -72,123 +155,14 @@ library
Paths_aoc_dev
hs-source-dirs:
src
default-extensions:
AllowAmbiguousTypes
ApplicativeDo
BangPatterns
BlockArguments
DataKinds
DeriveFoldable
DeriveFunctor
DeriveGeneric
DeriveTraversable
EmptyCase
FlexibleContexts
FlexibleInstances
FunctionalDependencies
GADTs
GeneralizedNewtypeDeriving
ImplicitParams
KindSignatures
LambdaCase
MonadComprehensions
MultiParamTypeClasses
MultiWayIf
NumDecimals
OverloadedLabels
PartialTypeSignatures
PatternGuards
PatternSynonyms
PolyKinds
RankNTypes
RecordWildCards
ScopedTypeVariables
StandaloneDeriving
TemplateHaskell
TupleSections
TypeApplications
TypeInType
TypeOperators
UndecidableInstances
ViewPatterns
ghc-options: -Wall -Wcompat -Wno-partial-type-signatures -Wredundant-constraints
build-depends:
advent-of-code-api >=0.2.7
, aeson
, ansi-terminal
, base >=4.7 && <5
, bytestring
, containers
, criterion
, data-default-class
, deepseq
, directory
, filepath
, finite-typelits
, haskeline
, haskell-names
, haskell-src-exts
, hpack
, megaparsec
, microlens-th
, mtl
, pandoc
, parser-combinators
, profunctors
, template-haskell
, text
, th-abstraction
, time
, transformers
, yaml
default-language: Haskell2010
other-modules:
Paths_aoc_dev

executable aoc-dev
import: common-options
main-is: aoc.hs
other-modules:
Paths_aoc_dev
hs-source-dirs:
app
default-extensions:
AllowAmbiguousTypes
ApplicativeDo
BangPatterns
BlockArguments
DataKinds
DeriveFoldable
DeriveFunctor
DeriveGeneric
DeriveTraversable
EmptyCase
FlexibleContexts
FlexibleInstances
FunctionalDependencies
GADTs
GeneralizedNewtypeDeriving
ImplicitParams
KindSignatures
LambdaCase
MonadComprehensions
MultiParamTypeClasses
MultiWayIf
NumDecimals
OverloadedLabels
PartialTypeSignatures
PatternGuards
PatternSynonyms
PolyKinds
RankNTypes
RecordWildCards
ScopedTypeVariables
StandaloneDeriving
TemplateHaskell
TupleSections
TypeApplications
TypeInType
TypeOperators
UndecidableInstances
ViewPatterns
ghc-options: -Wall -Wcompat -Wno-partial-type-signatures -Wredundant-constraints -threaded -rtsopts -with-rtsopts=-N
build-depends:
ansi-terminal
, aoc-dev
Expand All @@ -200,54 +174,15 @@ executable aoc-dev
, mtl
, optparse-applicative
default-language: Haskell2010
ghc-options: -threaded -rtsopts -with-rtsopts=-N

test-suite aoc-dev-test
import: common-options
type: exitcode-stdio-1.0
main-is: Spec.hs
other-modules:
Paths_aoc_dev
hs-source-dirs:
test
default-extensions:
AllowAmbiguousTypes
ApplicativeDo
BangPatterns
BlockArguments
DataKinds
DeriveFoldable
DeriveFunctor
DeriveGeneric
DeriveTraversable
EmptyCase
FlexibleContexts
FlexibleInstances
FunctionalDependencies
GADTs
GeneralizedNewtypeDeriving
ImplicitParams
KindSignatures
LambdaCase
MonadComprehensions
MultiParamTypeClasses
MultiWayIf
NumDecimals
OverloadedLabels
PartialTypeSignatures
PatternGuards
PatternSynonyms
PolyKinds
RankNTypes
RecordWildCards
ScopedTypeVariables
StandaloneDeriving
TemplateHaskell
TupleSections
TypeApplications
TypeInType
TypeOperators
UndecidableInstances
ViewPatterns
ghc-options: -Wall -Wcompat -Wno-partial-type-signatures -Wredundant-constraints -threaded -rtsopts -with-rtsopts=-N
ghc-options: -threaded -rtsopts -with-rtsopts=-N
build-depends:
ansi-terminal
, aoc-dev
Expand All @@ -258,52 +193,12 @@ test-suite aoc-dev-test
benchmark aoc-dev-bench
type: exitcode-stdio-1.0
main-is: Bench.hs
other-modules:
Paths_aoc_dev
hs-source-dirs:
bench
default-extensions:
AllowAmbiguousTypes
ApplicativeDo
BangPatterns
BlockArguments
DataKinds
DeriveFoldable
DeriveFunctor
DeriveGeneric
DeriveTraversable
EmptyCase
FlexibleContexts
FlexibleInstances
FunctionalDependencies
GADTs
GeneralizedNewtypeDeriving
ImplicitParams
KindSignatures
LambdaCase
MonadComprehensions
MultiParamTypeClasses
MultiWayIf
NumDecimals
OverloadedLabels
PartialTypeSignatures
PatternGuards
PatternSynonyms
PolyKinds
RankNTypes
RecordWildCards
ScopedTypeVariables
StandaloneDeriving
TemplateHaskell
TupleSections
TypeApplications
TypeInType
TypeOperators
UndecidableInstances
ViewPatterns
ghc-options: -Wall -Wcompat -Wno-partial-type-signatures -Wredundant-constraints -threaded -rtsopts -with-rtsopts=-N -O2
ghc-options: -threaded -rtsopts -with-rtsopts=-N
build-depends:
aoc-dev
, base >=4.7 && <5
, mtl
default-language: Haskell2010

6 changes: 3 additions & 3 deletions app/aoc.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ import Control.Monad.Except
import Data.Char
import Data.Foldable
import Data.IORef
import Data.List
import Data.Maybe
import Lens.Micro
import Options.Applicative
import System.IO.Error
import Text.Printf
import Text.Read
import qualified Data.List as L
import qualified Data.Map as M
import qualified System.Console.ANSI as ANSI

Expand All @@ -36,7 +36,7 @@ main = do
<> header "aoc-dev - Advent of Code interactive development environment"
<> progDesc ("Run, test, bench, challenges from Advent of Code, and view prompts. Available days: " ++ availableDays)
)
cfg@Cfg{..} <- configFile $ fromMaybe defConfPath _oConfig
cfg <- configFile $ fromMaybe defConfPath _oConfig
out <- runExceptT $ case _oMode of
MRun mro -> void $ mainRun cfg mro
MView mvo -> void $ mainView cfg mvo
Expand All @@ -46,7 +46,7 @@ main = do
putStrLn "[ERROR]"
mapM_ putStrLn e
where
availableDays = intercalate ", "
availableDays = L.intercalate ", "
. map (show . dayInt)
. M.keys
$ challengeMap
Expand Down
Loading

0 comments on commit 842d8dd

Please sign in to comment.