Skip to content

Commit

Permalink
Migrate to ghc 9.2 (#172)
Browse files Browse the repository at this point in the history
* Migrate to GHC 9.2

* Use new packages and GHC2021

* ImportQualifiedPost and OverloadedRecordDot

* Remove extraneous imports

* Expand some field access

* Fix dot sections

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
tchoutri and mergify[bot] authored Aug 24, 2022
1 parent b7a0377 commit ff441a2
Show file tree
Hide file tree
Showing 77 changed files with 403 additions and 569 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
id: setup-haskell
uses: haskell/actions/setup@v1
with:
ghc-version: "8.10.7"
ghc-version: "9.2.4"
cabal-version: "latest"

- name: Configure environment
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# syntax=docker/dockerfile:1
FROM gbogard/haskell-bullseye:8.10.7
FROM gbogard/haskell-bullseye:9.2.4

# generate a working directory
WORKDIR /flora-server
Expand Down
16 changes: 8 additions & 8 deletions app/cli/DesignSystem.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,24 @@ module DesignSystem where

import Control.Monad.Trans.Reader (runReaderT)
import Data.ByteString.Lazy (ByteString)
import qualified Data.ByteString.Lazy as ByteString
import Data.ByteString.Lazy qualified as ByteString
import Data.Foldable (forM_)
import Data.Functor.Identity (runIdentity)
import qualified Data.UUID as UUID
import Data.UUID qualified as UUID
import Data.Vector (Vector)
import qualified Data.Vector as Vector
import Data.Vector qualified as Vector
import Effectful
import Lucid.Base

import Data.Text (Text)
import qualified Data.Text.Lazy as TL
import Data.Text.Lazy qualified as TL
import Flora.Model.Category
import qualified Flora.Model.Category as Category
import Flora.Model.Category qualified as Category
import Flora.Model.Package
import Flora.Search
import qualified FloraWeb.Components.CategoryCard as Component
import qualified FloraWeb.Components.PackageListItem as Component
import qualified FloraWeb.Components.PaginationNav as Component
import FloraWeb.Components.CategoryCard qualified as Component
import FloraWeb.Components.PackageListItem qualified as Component
import FloraWeb.Components.PaginationNav qualified as Component
import FloraWeb.Templates (FloraHTML, defaultTemplateEnv, defaultsToEnv)
import Lucid
import PyF (fmt)
Expand Down
3 changes: 1 addition & 2 deletions app/cli/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ import Data.Password.Types
import Data.Text (Text)
import DesignSystem (generateComponents)
import Effectful
import Effectful.Dispatch.Static
import Effectful.PostgreSQL.Transact.Effect
import qualified Flora.Model.User.Query as Query
import Flora.Model.User.Query qualified as Query
import GHC.Generics (Generic)
import Optics.Core
import Options.Applicative
Expand Down
14 changes: 6 additions & 8 deletions cabal.project
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
packages: ./

with-compiler: ghc-8.10.7
with-compiler: ghc-9.2

jobs: 8

Expand All @@ -23,6 +23,11 @@ source-repository-package
tag: 9dacea2bec9c6f5d9f7d46a2a1d9094cf6147fbf
subdir: ./raven-haskell

source-repository-package
type: git
location: https://github.com/guibou/PyF
tag: v0.11.0.0

source-repository-package
type: git
location: https://github.com/supki/envparse
Expand Down Expand Up @@ -76,10 +81,3 @@ source-repository-package
source-repository-package
type: git
location: https://github.com/haskell-effectful/time-effectful

source-repository-package
type: git
location: https://github.com/haskell-effectful/effectful
tag: 413cb63
subdir: ./effectful
./effectful-core
65 changes: 33 additions & 32 deletions cabal.project.freeze
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
active-repositories: hackage.haskell.org:merge
constraints: any.Cabal ==3.2.1.0,
constraints: any.Cabal ==3.6.3.0,
any.Cabal-syntax ==3.8.1.0,
any.HUnit ==1.6.2.0,
any.OneTuple ==0.3.1,
Expand All @@ -12,7 +12,7 @@ constraints: any.Cabal ==3.2.1.0,
any.SHA ==1.6.4.4,
SHA -exe,
any.StateVar ==1.2.2,
any.adjunctions ==4.4.1,
any.adjunctions ==4.4.2,
any.aeson ==2.1.0.0,
aeson -cffi +ordered-keymap,
any.aeson-pretty ==0.8.9,
Expand All @@ -37,17 +37,17 @@ constraints: any.Cabal ==3.2.1.0,
any.authenticate-oauth ==1.7,
any.auto-update ==0.1.6,
any.barbies ==2.0.3.1,
any.base ==4.14.3.0,
any.base ==4.16.3.0,
any.base-compat ==0.12.2,
any.base-compat-batteries ==0.12.2,
any.base-orphans ==0.8.7,
any.base16-bytestring ==1.0.2.0,
any.base64 ==0.4.2.4,
any.base64-bytestring ==1.2.1.0,
any.basement ==0.0.14,
any.basement ==0.0.15,
any.bifunctors ==5.5.12,
bifunctors +semigroups +tagged,
any.binary ==0.8.8.0,
any.binary ==0.8.9.0,
any.bitvec ==1.1.3.0,
bitvec -libgmp,
any.blaze-builder ==0.4.2.2,
Expand All @@ -58,7 +58,7 @@ constraints: any.Cabal ==3.2.1.0,
any.bsb-http-chunked ==0.0.0.4,
any.byteable ==0.1.1,
any.byteorder ==1.0.4,
any.bytestring ==0.10.12.0,
any.bytestring ==0.11.3.1,
any.bytestring-builder ==0.10.8.2.0,
bytestring-builder +bytestring_has_builder,
any.cabal-doctest ==1.0.9,
Expand Down Expand Up @@ -104,27 +104,27 @@ constraints: any.Cabal ==3.2.1.0,
any.data-fix ==0.3.2,
any.data-sketches ==0.3.1.0,
any.data-sketches-core ==0.1.0.0,
any.dec ==0.0.4,
any.deepseq ==1.4.4.0,
any.directory ==1.3.6.0,
any.dec ==0.0.5,
any.deepseq ==1.4.6.1,
any.directory ==1.3.6.2,
any.distributive ==0.6.2.1,
distributive +semigroups +tagged,
any.dlist ==1.0,
dlist -werror,
any.easy-file ==0.2.2,
any.effectful ==1.1.0.0,
any.effectful ==2.0.0.0,
effectful -benchmark-foreign-libraries,
any.effectful-core ==1.1.0.0,
any.effectful-core ==2.0.0.0,
any.either ==5.0.2,
any.emojis ==0.1.2,
any.entropy ==0.4.1.7,
entropy -halvm,
any.entropy ==0.4.1.10,
entropy -donotgetentropy,
any.envparse ==0.5.0,
any.erf ==2.0.0.0,
any.exceptions ==0.10.4,
any.fast-logger ==3.1.1,
any.file-embed ==0.0.15.0,
any.filepath ==1.4.2.1,
any.filepath ==1.4.2.2,
any.filtrable ==0.1.6.0,
filtrable +containers,
flora -prod,
Expand All @@ -134,12 +134,13 @@ constraints: any.Cabal ==3.2.1.0,
any.generic-deriving ==1.14.2,
generic-deriving +base-4-9,
any.generically ==0.1,
any.ghc ==8.10.7,
any.ghc-boot ==8.10.7,
any.ghc-boot-th ==8.10.7,
any.ghc-heap ==8.10.7,
any.ghc-prim ==0.6.1,
any.ghci ==8.10.7,
any.ghc ==9.2.4,
any.ghc-bignum ==1.2,
any.ghc-boot ==9.2.4,
any.ghc-boot-th ==9.2.4,
any.ghc-heap ==9.2.4,
any.ghc-prim ==0.8.0,
any.ghci ==9.2.4,
any.happy ==1.20.0,
any.hashable ==1.4.1.0,
hashable +containers +integer-gmp -random-initial-seed,
Expand All @@ -165,7 +166,7 @@ constraints: any.Cabal ==3.2.1.0,
any.indexed-profunctors ==0.1.1,
any.indexed-traversable ==0.1.2,
any.indexed-traversable-instances ==0.1.1.1,
any.integer-gmp ==1.0.3.0,
any.integer-gmp ==1.1,
any.integer-logarithms ==1.0.3.1,
integer-logarithms -check-bounds +integer-gmp,
any.invariant ==0.6,
Expand All @@ -176,7 +177,7 @@ constraints: any.Cabal ==3.2.1.0,
any.lens ==5.2,
lens -benchmark-uniplate -dump-splices +inlining -j +test-hunit +test-properties +test-templates +trustworthy,
any.lens-aeson ==1.2.2,
any.lifted-async ==0.10.2.2,
any.lifted-async ==0.10.2.3,
any.lifted-base ==0.2.3.12,
any.log-base ==0.11.1.0,
any.log-effectful ==0.0.1.0,
Expand Down Expand Up @@ -213,10 +214,10 @@ constraints: any.Cabal ==3.2.1.0,
any.optparse-applicative ==0.17.0.0,
optparse-applicative +process,
any.parallel ==3.2.2.0,
any.parsec ==3.1.14.0,
any.parsec ==3.1.15.0,
any.password ==3.0.1.0,
any.password-types ==1.0.0.0,
any.pcre2 ==2.1.1.1,
any.pcre2 ==2.2.1,
any.pem ==0.2.4,
any.pg-entity ==0.0.1.0,
pg-entity -prod,
Expand Down Expand Up @@ -248,7 +249,7 @@ constraints: any.Cabal ==3.2.1.0,
any.regex-applicative ==0.3.4,
any.resource-pool ==0.3.1.0,
any.resourcet ==1.2.6,
any.rts ==1.0.1,
any.rts ==1.0.2,
any.safe ==0.3.19,
any.safe-exceptions ==0.1.7.3,
any.scientific ==0.3.7.0,
Expand Down Expand Up @@ -281,7 +282,7 @@ constraints: any.Cabal ==3.2.1.0,
any.split ==0.2.3.5,
any.splitmix ==0.1.0.4,
splitmix -optimised-mixer,
any.stm ==2.5.0.1,
any.stm ==2.5.0.2,
any.stm-chans ==3.0.0.6,
any.streaming ==0.2.3.1,
any.streaming-commons ==0.2.2.4,
Expand All @@ -296,21 +297,21 @@ constraints: any.Cabal ==3.2.1.0,
any.tasty ==1.4.2.3,
tasty +clock +unix,
any.tasty-hunit ==0.10.0.3,
any.template-haskell ==2.16.0.0,
any.template-haskell ==2.18.0.0,
any.temporary ==1.3,
any.terminal-size ==0.3.3,
any.terminfo ==0.4.1.4,
any.text ==1.2.4.1,
any.terminfo ==0.4.1.5,
any.text ==2.0.1,
any.text-conversions ==0.3.1.1,
any.text-display ==0.0.2.0,
any.text-display ==0.0.3.0,
any.text-manipulate ==0.3.1.0,
any.text-short ==0.1.5,
text-short -asserts,
any.th-abstraction ==0.4.4.0,
any.th-compat ==0.1.4,
any.these ==1.1.1.1,
these +assoc,
any.time ==1.9.3,
any.time ==1.11.1.1,
any.time-compat ==1.9.6.1,
time-compat -old-locale,
any.time-effectful ==0.0.1.0,
Expand Down Expand Up @@ -382,4 +383,4 @@ constraints: any.Cabal ==3.2.1.0,
any.x509-validation ==1.6.12,
any.zlib ==0.6.3.0,
zlib -bundled-c-zlib -non-blocking-ffi -pkg-config
index-state: hackage.haskell.org 2022-08-12T12:42:08Z
index-state: hackage.haskell.org 2022-08-23T14:54:28Z
34 changes: 11 additions & 23 deletions flora.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -25,49 +25,38 @@ flag prod

common common-extensions
default-extensions:
NoMonomorphismRestriction
NoStarIsType
ConstraintKinds
DataKinds
DeriveAnyClass
DeriveGeneric
DerivingStrategies
DerivingVia
DuplicateRecordFields
FlexibleContexts
FlexibleInstances
GeneralizedNewtypeDeriving
InstanceSigs
KindSignatures
LambdaCase
MultiParamTypeClasses
NamedFieldPuns
OverloadedLabels
OverloadedStrings
PolyKinds
QuasiQuotes
RankNTypes
RecordWildCards
ScopedTypeVariables
StandaloneDeriving
StrictData
TypeApplications
TypeFamilies
TypeOperators
UndecidableInstances
ViewPatterns
OverloadedRecordDot

default-language: Haskell2010
default-language: GHC2021

common common-ghc-options
ghc-options:
-Wall -Wcompat -Widentities -Wincomplete-record-updates
-Wincomplete-uni-patterns -Wpartial-fields -Wredundant-constraints
-fhide-source-paths -Wno-unused-do-bind -fshow-hole-constraints
-fprint-potential-instances -Wno-unticked-promoted-constructors
-Werror=unused-imports

if flag(prod)
ghc-options: -flate-specialise -funbox-strict-fields
ghc-options:
-flate-specialise -funbox-strict-fields
-finline-generics-aggressively

common common-rts-options
ghc-options: -threaded "-with-rtsopts=-N -T"
Expand Down Expand Up @@ -96,7 +85,6 @@ library
Flora.Import.Types
Flora.Model.Admin.Report
Flora.Model.Category
Flora.Model.Category.Coverage
Flora.Model.Category.Query
Flora.Model.Category.Types
Flora.Model.Category.Update
Expand Down Expand Up @@ -185,7 +173,7 @@ library
build-depends:
, aeson <=1.6
, async ^>=2.2
, base ^>=4.14
, base ^>=4.16
, blaze-builder
, bytestring ^>=0.10
, Cabal-syntax ^>=3.8
Expand Down Expand Up @@ -223,7 +211,7 @@ library
, optparse-applicative ^>=0.16
, password ^>=3.0
, password-types ^>=1.0
, pcre2 ^>=2.0
, pcre2
, pg-entity ^>=0.0
, pg-transact ^>=0.3
, pg-transact-effectful
Expand All @@ -233,7 +221,7 @@ library
, prometheus-client ^>=1.1
, prometheus-metrics-ghc ^>=1.0
, prometheus-proc ^>=0.1
, PyF ^>=0.10
, PyF ^>=0.11
, raven-haskell ^>=0.1
, resource-pool >=0.3 && <0.4.0.0
, safe-exceptions
Expand All @@ -249,8 +237,8 @@ library
, split ^>=0.2
, streaming ^>=0.2
, template-haskell
, text ^>=1.2
, text-display ^>=0.0.2
, text
, text-display
, time ^>=1.9
, time-effectful
, transformers ^>=0.5
Expand Down
6 changes: 3 additions & 3 deletions src/Data/Aeson/Orphans.hs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
module Data.Aeson.Orphans where

import Data.Aeson
import qualified Data.Text as T
import Data.Text qualified as T
import Distribution.Parsec (simpleParsec)
import qualified Distribution.Pretty as Pretty
import qualified Distribution.SPDX.License as SPDX
import Distribution.Pretty qualified as Pretty
import Distribution.SPDX.License qualified as SPDX

instance FromJSON SPDX.License where
parseJSON = withText "SPDX License" $ \s ->
Expand Down
Loading

0 comments on commit ff441a2

Please sign in to comment.