Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stanza polyfill for GHC2024 #1100

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 66 additions & 17 deletions skeleton/backend/backend.cabal
Original file line number Diff line number Diff line change
@@ -1,9 +1,73 @@
cabal-version: 2.2
name: backend
version: 0.1
cabal-version: >= 1.8
build-type: Simple

common ghc2021
default-language: Haskell2010
default-extensions:
BangPatterns
BinaryLiterals
ConstraintKinds
DeriveDataTypeable
DeriveGeneric
DeriveLift
DeriveTraversable
DoAndIfThenElse
EmptyCase
EmptyDataDecls
EmptyDataDeriving
ExistentialQuantification
FlexibleContexts
FlexibleInstances
ForeignFunctionInterface
GADTSyntax
GeneralisedNewtypeDeriving
HexFloatLiterals
ImportQualifiedPost
InstanceSigs
MonoLocalBinds
MultiParamTypeClasses
NamedFieldPuns
NamedWildCards
NumericUnderscores
PatternGuards
PolyKinds
PostfixOperators
RankNTypes
RelaxedPolyRec
ScopedTypeVariables
StandaloneDeriving
StandaloneKindSignatures
StarIsType
TraditionalRecordSyntax
TupleSections
TypeApplications
TypeOperators

common ghc2024
import: ghc2021
default-extensions:
DataKinds
DerivingStrategies
DisambiguateRecordFields
GADTs
LambdaCase
RoleAnnotations

common defaults
import: ghc2024
ghc-options: -Wall -O -fno-show-valid-hole-fits
-- unsafe code
-Wincomplete-record-updates -Wincomplete-uni-patterns -Wpartial-fields
-- unneeded code
-Widentities -Wredundant-constraints
if impl(ghc >= 8.8)
ghc-options:
-Wmissing-deriving-strategies

library
import: defaults
hs-source-dirs: src
if impl(ghcjs)
buildable: False
Expand All @@ -14,26 +78,11 @@ library
, obelisk-route
exposed-modules:
Backend
ghc-options: -Wall -O -fno-show-valid-hole-fits
-- unsafe code
-Wincomplete-record-updates -Wincomplete-uni-patterns -Wpartial-fields
-- unneeded code
-Widentities -Wredundant-constraints
if impl(ghc >= 8.8)
ghc-options:
-Wmissing-deriving-strategies

executable backend
import: defaults
main-is: main.hs
hs-source-dirs: src-bin
ghc-options: -Wall -O -fno-show-valid-hole-fits -threaded
-- unsafe code
-Wincomplete-record-updates -Wincomplete-uni-patterns -Wpartial-fields
-- unneeded code
-Widentities -Wredundant-constraints
if impl(ghc >= 8.8)
ghc-options:
-Wmissing-deriving-strategies
if impl(ghcjs)
buildable: False
build-depends: base
Expand Down
74 changes: 65 additions & 9 deletions skeleton/common/common.cabal
Original file line number Diff line number Diff line change
@@ -1,16 +1,62 @@
cabal-version: 2.2
name: common
version: 0.1
cabal-version: >= 1.2
build-type: Simple

library
hs-source-dirs: src
build-depends: base
, obelisk-route
, text
exposed-modules:
Common.Api
Common.Route
common ghc2021
default-language: Haskell2010
default-extensions:
BangPatterns
BinaryLiterals
ConstraintKinds
DeriveDataTypeable
DeriveGeneric
DeriveLift
DeriveTraversable
DoAndIfThenElse
EmptyCase
EmptyDataDecls
EmptyDataDeriving
ExistentialQuantification
FlexibleContexts
FlexibleInstances
ForeignFunctionInterface
GADTSyntax
GeneralisedNewtypeDeriving
HexFloatLiterals
ImportQualifiedPost
InstanceSigs
MonoLocalBinds
MultiParamTypeClasses
NamedFieldPuns
NamedWildCards
NumericUnderscores
PatternGuards
PolyKinds
PostfixOperators
RankNTypes
RelaxedPolyRec
ScopedTypeVariables
StandaloneDeriving
StandaloneKindSignatures
StarIsType
TraditionalRecordSyntax
TupleSections
TypeApplications
TypeOperators

common ghc2024
import: ghc2021
default-extensions:
DataKinds
DerivingStrategies
DisambiguateRecordFields
GADTs
LambdaCase
RoleAnnotations

common defaults
import: ghc2024
ghc-options: -Wall -O -fno-show-valid-hole-fits
-- unsafe code
-Wincomplete-record-updates -Wincomplete-uni-patterns -Wpartial-fields
Expand All @@ -19,3 +65,13 @@ library
if impl(ghc >= 8.8)
ghc-options:
-Wmissing-deriving-strategies

library
import: defaults
hs-source-dirs: src
build-depends: base
, obelisk-route
, text
exposed-modules:
Common.Api
Common.Route
9 changes: 0 additions & 9 deletions skeleton/common/src/Common/Route.hs
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE EmptyCase #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
module Common.Route where
Expand Down
83 changes: 66 additions & 17 deletions skeleton/frontend/frontend.cabal
Original file line number Diff line number Diff line change
@@ -1,9 +1,73 @@
cabal-version: 2.2
name: frontend
version: 0.1
cabal-version: >= 1.8
build-type: Simple

common ghc2021
default-language: Haskell2010
default-extensions:
BangPatterns
BinaryLiterals
ConstraintKinds
DeriveDataTypeable
DeriveGeneric
DeriveLift
DeriveTraversable
DoAndIfThenElse
EmptyCase
EmptyDataDecls
EmptyDataDeriving
ExistentialQuantification
FlexibleContexts
FlexibleInstances
ForeignFunctionInterface
GADTSyntax
GeneralisedNewtypeDeriving
HexFloatLiterals
ImportQualifiedPost
InstanceSigs
MonoLocalBinds
MultiParamTypeClasses
NamedFieldPuns
NamedWildCards
NumericUnderscores
PatternGuards
PolyKinds
PostfixOperators
RankNTypes
RelaxedPolyRec
ScopedTypeVariables
StandaloneDeriving
StandaloneKindSignatures
StarIsType
TraditionalRecordSyntax
TupleSections
TypeApplications
TypeOperators

common ghc2024
import: ghc2021
default-extensions:
DataKinds
DerivingStrategies
DisambiguateRecordFields
GADTs
LambdaCase
RoleAnnotations

common defaults
import: ghc2024
ghc-options: -Wall -O -fno-show-valid-hole-fits
-- unsafe code
-Wincomplete-record-updates -Wincomplete-uni-patterns -Wpartial-fields
-- unneeded code
-Widentities -Wredundant-constraints
if impl(ghc >= 8.8)
ghc-options:
-Wmissing-deriving-strategies

library
import: defaults
hs-source-dirs: src
build-depends: base
, common
Expand All @@ -17,16 +81,9 @@ library
, text
exposed-modules:
Frontend
ghc-options: -Wall -O -fno-show-valid-hole-fits
-- unsafe code
-Wincomplete-record-updates -Wincomplete-uni-patterns -Wpartial-fields
-- unneeded code
-Widentities -Wredundant-constraints
if impl(ghc >= 8.8)
ghc-options:
-Wmissing-deriving-strategies

executable frontend
import: defaults
main-is: main.hs
hs-source-dirs: src-bin
build-depends: base
Expand All @@ -35,14 +92,6 @@ executable frontend
, obelisk-frontend
, obelisk-route
, reflex-dom
ghc-options: -Wall -O -fno-show-valid-hole-fits -threaded
-- unsafe code
-Wincomplete-record-updates -Wincomplete-uni-patterns -Wpartial-fields
-- unneeded code
-Widentities -Wredundant-constraints
if impl(ghc >= 8.8)
ghc-options:
-Wmissing-deriving-strategies
if impl(ghcjs)
ghc-options: -dedupe
cpp-options: -DGHCJS_BROWSER
Expand Down
1 change: 0 additions & 1 deletion skeleton/frontend/src/Frontend.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE TemplateHaskell #-}

module Frontend where
Expand Down