Skip to content

Commit

Permalink
Drop support for GHC 8.2 (dhall-lang#1949)
Browse files Browse the repository at this point in the history
…and do some general cleanup of compatibility code.

Closes dhall-lang#1947.

* Remove Nix config for GHC 8.2

* Remove redundant imports of Data.Monoid

* Clean up imports of Data.Semigroup

* Canonicalize mappend definitions

* Move MonadFail import behind CPP

* Remove compat code for directory < 1.2.3

* Remove compat code for containers < 0.5.8

* Remove compat code for template-haskell < 2.12

* Revert "Canonicalize mappend definitions"

This reverts commit fce85a3.

* Remove mappend definitions

* Update version constraints

* Remove compat code for http-client < 0.5

* Dhall.LSP.Backend.Parsing: Remove redundant import

* Clean up conditional dependencies in cabal files

* Fix more lower bounds on base

* Dhall.Map.withoutKeys: Rely on Data.Map.withoutKeys

* Remove redundant LANGUAGE CPP pragmas
  • Loading branch information
sjakobi authored Jul 28, 2020
1 parent 7ceb258 commit c3f6c40
Show file tree
Hide file tree
Showing 74 changed files with 80 additions and 308 deletions.
16 changes: 8 additions & 8 deletions dhall-bash/dhall-bash.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Name: dhall-bash
Version: 1.0.31
Cabal-Version: >=1.10
Build-Type: Simple
Tested-With: GHC == 8.2.2, GHC == 8.4.3, GHC == 8.6.1
Tested-With: GHC == 8.4.3, GHC == 8.6.1
License: BSD3
License-File: LICENSE
Copyright: 2017 Gabriel Gonzalez
Expand All @@ -28,13 +28,13 @@ Source-Repository head
Library
Hs-Source-Dirs: src
Build-Depends:
base >= 4.8.0.0 && < 5 ,
bytestring < 0.11,
containers < 0.7 ,
dhall >= 1.33.0 && < 1.34,
neat-interpolation < 0.6 ,
shell-escape < 0.3 ,
text >= 0.2 && < 1.3
base >= 4.11.0.0 && < 5 ,
bytestring < 0.11,
containers < 0.7 ,
dhall >= 1.33.0 && < 1.34,
neat-interpolation < 0.6 ,
shell-escape < 0.3 ,
text >= 0.2 && < 1.3
Exposed-Modules: Dhall.Bash
GHC-Options: -Wall
Default-Language: Haskell2010
Expand Down
1 change: 0 additions & 1 deletion dhall-bash/src/Dhall/Bash.hs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ module Dhall.Bash (
import Control.Exception (Exception)
import Data.Bifunctor (first)
import Data.ByteString
import Data.Monoid ((<>))
import Data.Typeable (Typeable)
import Data.Void (Void, absurd)
import Dhall.Core (Chunks (..), Expr (..))
Expand Down
34 changes: 17 additions & 17 deletions dhall-docs/dhall-docs.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -59,23 +59,23 @@ Flag ghci-data-files
Library
Hs-Source-Dirs: src
Build-Depends:
base >= 4.9.1.0 && < 5 ,
bytestring < 0.11,
containers ,
directory >= 1.3.0.0 && < 1.4 ,
dhall >= 1.32.0 ,
file-embed >= 0.0.10.0 ,
filepath >= 1.4 && < 1.5 ,
lucid >= 2.9.12 && < 2.10,
mmark >= 0.0.7.0 && < 0.8 ,
megaparsec >= 7 && < 8.1 ,
path >= 0.7.0 && < 0.8 ,
path-io >= 1.6.0 && < 1.7 ,
prettyprinter >= 1.5.1 && < 1.7 ,
tar >= 0.5.1.0 && < 0.6 ,
text >= 0.11.1.0 && < 1.3 ,
mtl >= 2.2.1 && < 2.3 ,
optparse-applicative >= 0.14.0.0 && < 0.16
base >= 4.11.0.0 && < 5 ,
bytestring < 0.11,
containers ,
directory >= 1.3.0.0 && < 1.4 ,
dhall >= 1.32.0 ,
file-embed >= 0.0.10.0 ,
filepath >= 1.4 && < 1.5 ,
lucid >= 2.9.12 && < 2.10,
mmark >= 0.0.7.0 && < 0.8 ,
megaparsec >= 7 && < 8.1 ,
path >= 0.7.0 && < 0.8 ,
path-io >= 1.6.0 && < 1.7 ,
prettyprinter >= 1.5.1 && < 1.7 ,
tar >= 0.5.1.0 && < 0.6 ,
text >= 0.11.1.0 && < 1.3 ,
mtl >= 2.2.1 && < 2.3 ,
optparse-applicative >= 0.14.0.0 && < 0.16
Exposed-Modules:
Dhall.Docs
Dhall.Docs.Core
Expand Down
1 change: 0 additions & 1 deletion dhall-docs/src/Dhall/Docs.hs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ module Dhall.Docs
) where

import Control.Applicative ((<|>))
import Data.Monoid ((<>))
import Data.Text (Text)
import Data.Version (showVersion)
import Dhall.Pretty (CharacterSet(..))
Expand Down
2 changes: 0 additions & 2 deletions dhall-docs/src/Dhall/Docs/Core.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
To do so, just wrap your function in `IO` if you need to do I/O operations,
and make pure functions receive that IO result as an input
-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE NamedFieldPuns #-}
Expand All @@ -30,7 +29,6 @@ import Control.Monad.Writer.Class (MonadWriter)
import Data.ByteString (ByteString)
import Data.Function (on)
import Data.Map.Strict (Map)
import Data.Monoid ((<>))
import Data.Text (Text)
import Data.Void (Void)
import Dhall.Core
Expand Down
1 change: 0 additions & 1 deletion dhall-docs/src/Dhall/Docs/Html.hs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ module Dhall.Docs.Html
, DocParams(..)
) where

import Data.Monoid ((<>))
import Data.Text (Text)
import Data.Void (Void)
import Dhall.Core (Expr, Import, denote)
Expand Down
34 changes: 16 additions & 18 deletions dhall-json/dhall-json.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Name: dhall-json
Version: 1.7.0
Cabal-Version: >=1.10
Build-Type: Simple
Tested-With: GHC == 8.2.2, GHC == 8.4.3, GHC == 8.6.1
Tested-With: GHC == 8.4.3, GHC == 8.6.1
License: BSD3
License-File: LICENSE
Copyright: 2017 Gabriel Gonzalez
Expand Down Expand Up @@ -38,21 +38,21 @@ Source-Repository head
Library
Hs-Source-Dirs: src
Build-Depends:
base >= 4.8.0.0 && < 5 ,
aeson >= 1.0.0.0 && < 1.6 ,
aeson-pretty < 0.9 ,
aeson-yaml >= 1.1.0 && < 1.2 ,
bytestring < 0.11,
containers >= 0.5.9 && < 0.7 ,
dhall >= 1.33.0 && < 1.34,
exceptions >= 0.8.3 && < 0.11,
filepath < 1.5 ,
lens-family-core >= 1.0.0 && < 2.2 ,
optparse-applicative >= 0.14.0.0 && < 0.16,
prettyprinter >= 1.5.1 && < 1.7 ,
scientific >= 0.3.0.0 && < 0.4 ,
text >= 0.11.1.0 && < 1.3 ,
unordered-containers < 0.3 ,
base >= 4.11.0.0 && < 5 ,
aeson >= 1.0.0.0 && < 1.6 ,
aeson-pretty < 0.9 ,
aeson-yaml >= 1.1.0 && < 1.2 ,
bytestring < 0.11,
containers >= 0.5.9 && < 0.7 ,
dhall >= 1.33.0 && < 1.34,
exceptions >= 0.8.3 && < 0.11,
filepath < 1.5 ,
lens-family-core >= 1.0.0 && < 2.2 ,
optparse-applicative >= 0.14.0.0 && < 0.16,
prettyprinter >= 1.5.1 && < 1.7 ,
scientific >= 0.3.0.0 && < 0.4 ,
text >= 0.11.1.0 && < 1.3 ,
unordered-containers < 0.3 ,
vector
Exposed-Modules:
Dhall.JSON
Expand Down Expand Up @@ -107,8 +107,6 @@ Executable json-to-dhall
prettyprinter ,
prettyprinter-ansi-terminal >= 1.1.1 && < 1.2 ,
text < 1.3
if !impl(ghc >= 8.0) && !impl(eta >= 0.8.4)
Build-Depends: semigroups == 0.18.*
Other-Modules:
Paths_dhall_json
GHC-Options: -Wall
Expand Down
1 change: 0 additions & 1 deletion dhall-json/dhall-to-json/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ module Main where
import Control.Applicative (optional, (<|>))
import Control.Exception (SomeException)
import Data.Aeson (Value)
import Data.Monoid ((<>))
import Data.Version (showVersion)
import Dhall.JSON (Conversion, SpecialDoubleMode (..))
import Options.Applicative (Parser, ParserInfo)
Expand Down
1 change: 0 additions & 1 deletion dhall-json/json-to-dhall/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ module Main where

import Control.Applicative (optional, (<|>))
import Control.Exception (SomeException, throwIO)
import Data.Monoid ((<>))
import Data.Text (Text)
import Data.Version (showVersion)
import Dhall.JSONToDhall
Expand Down
1 change: 0 additions & 1 deletion dhall-json/src/Dhall/DhallToYaml/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ module Dhall.DhallToYaml.Main (main) where
import Control.Applicative (optional, (<|>))
import Control.Exception (SomeException)
import Data.ByteString (ByteString)
import Data.Monoid ((<>))
import Data.Text (Text)
import Dhall.JSON (parseConversion, parsePreservationAndOmission)
import Dhall.JSON.Yaml (Options (..), parseDocuments, parseQuoted)
Expand Down
1 change: 0 additions & 1 deletion dhall-json/src/Dhall/JSON.hs
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@ import Control.Exception (Exception, throwIO)
import Control.Monad (guard)
import Data.Aeson (ToJSON (..), Value (..))
import Data.Maybe (fromMaybe)
import Data.Monoid (mempty, (<>))
import Data.Text (Text)
import Data.Text.Prettyprint.Doc (Pretty)
import Data.Void (Void)
Expand Down
1 change: 0 additions & 1 deletion dhall-json/src/Dhall/JSON/Yaml.hs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ module Dhall.JSON.Yaml
) where

import Data.ByteString (ByteString)
import Data.Monoid ((<>))
import Data.Text (Text)
import Dhall.JSON (Conversion (..), SpecialDoubleMode (..))
import Options.Applicative (Parser)
Expand Down
7 changes: 0 additions & 7 deletions dhall-json/src/Dhall/JSONToDhall.hs
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,6 @@ import Data.Foldable (toList)
import Data.List ((\\))
import Data.Monoid (Any (..))
import Data.Scientific (floatingOrInteger, toRealFloat)
import Data.Semigroup (Semigroup (..))
import Data.Text (Text)
import Data.Void (Void)
import Dhall.Core (Chunks (..), DhallDouble (..), Expr (App))
Expand Down Expand Up @@ -598,8 +597,6 @@ instance Semigroup UnionNumber where
instance Monoid UnionNumber where
mempty = minBound

mappend = (<>)

unionNumberToAlternatives :: UnionNumber -> [ (Text, Maybe (Expr s a)) ]
unionNumberToAlternatives UnionAbsent = []
unionNumberToAlternatives UnionNatural = [ ("Natural", Just D.Natural) ]
Expand Down Expand Up @@ -659,8 +656,6 @@ instance Monoid UnionSchema where

text = mempty

mappend = (<>)

{-| A `Schema` is a subset of the `Expr` type representing all possible
Dhall types that `inferSchema` could potentially return
-}
Expand Down Expand Up @@ -761,8 +756,6 @@ instance Semigroup Schema where
instance Monoid Schema where
mempty = Union mempty

mappend = (<>)

-- | Convert a `Schema` to the corresponding Dhall type
schemaToDhallType :: Schema -> Expr s a
schemaToDhallType Bool = D.Bool
Expand Down
1 change: 0 additions & 1 deletion dhall-json/tasty/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

module Main where

import Data.Monoid ((<>))
import Data.Void (Void)
import Test.Tasty (TestTree)

Expand Down
1 change: 0 additions & 1 deletion dhall-lsp-server/app/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ module Main
where

import Control.Applicative ((<|>))
import Data.Monoid ((<>))
import Options.Applicative (Parser, ParserInfo)

import qualified Data.Version
Expand Down
7 changes: 1 addition & 6 deletions dhall-lsp-server/dhall-lsp-server.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,6 @@ library
, uri-encode >= 1.5.0.5 && < 1.6
default-language: Haskell2010
GHC-Options: -Wall -fwarn-incomplete-uni-patterns
if impl(eta)
buildable: False


executable dhall-lsp-server
main-is: Main.hs
Expand All @@ -81,13 +78,11 @@ executable dhall-lsp-server
default-extensions: RecordWildCards OverloadedStrings
ghc-options: -rtsopts
build-depends:
base >=4.7 && <5
base
, dhall-lsp-server
, optparse-applicative
default-language: Haskell2010
GHC-Options: -Wall -fwarn-incomplete-uni-patterns
if impl(eta)
buildable: False

Test-Suite doctest
Type: exitcode-stdio-1.0
Expand Down
1 change: 0 additions & 1 deletion dhall-lsp-server/doctest/Main.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
module Main where

import Data.Monoid ((<>))
import System.FilePath ((</>))

import qualified GHC.IO.Encoding
Expand Down
1 change: 0 additions & 1 deletion dhall-lsp-server/src/Dhall/LSP/Backend/Diagnostics.hs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import Dhall.LSP.Util

import Control.Lens (toListOf)
import Control.Monad.Trans.Writer (Writer, execWriter, tell)
import Data.Monoid ((<>))
import Data.Text (Text)

import qualified Data.List.NonEmpty as NonEmpty
Expand Down
1 change: 0 additions & 1 deletion dhall-lsp-server/src/Dhall/LSP/Backend/Formatting.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
module Dhall.LSP.Backend.Formatting (formatExpr, formatExprWithHeader) where

import Data.Monoid ((<>))
import Data.Text (Text)
import Dhall.Core (Expr)
import Dhall.Parser (Header (..))
Expand Down
1 change: 0 additions & 1 deletion dhall-lsp-server/src/Dhall/LSP/Backend/Linting.hs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ where

import Control.Lens (universeOf)
import Data.Maybe (maybeToList)
import Data.Monoid ((<>))
import Data.Text (Text)
import Dhall.Core
( Binding (..)
Expand Down
1 change: 0 additions & 1 deletion dhall-lsp-server/src/Dhall/LSP/Backend/Parsing.hs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import Dhall.Parser.Expression
, localOnly
)
import Dhall.Parser.Token hiding (text)
import Dhall.Src (Src (..))
import Text.Megaparsec
( anySingle
, eof
Expand Down
20 changes: 10 additions & 10 deletions dhall-nix/dhall-nix.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,23 @@ Source-Repository head
Library
Hs-Source-Dirs: src
Build-Depends:
base >= 4.8.0.0 && < 5 ,
containers < 0.7 ,
data-fix < 0.4 ,
dhall >= 1.31 && < 1.34,
hnix >= 0.7 && < 0.10,
lens-family-core >= 1.0.0 && < 2.2 ,
neat-interpolation < 0.6 ,
text >= 0.8.0.0 && < 1.3
base >= 4.11.0.0 && < 5 ,
containers < 0.7 ,
data-fix < 0.4 ,
dhall >= 1.31 && < 1.34,
hnix >= 0.7 && < 0.10,
lens-family-core >= 1.0.0 && < 2.2 ,
neat-interpolation < 0.6 ,
text >= 0.8.0.0 && < 1.3
Exposed-Modules:
Dhall.Nix
GHC-Options: -Wall
Default-Language: Haskell2010
if os(windows) || impl(eta)
if os(windows)
Buildable: False

Executable dhall-to-nix
if os(windows) || impl(eta)
if os(windows)
Buildable: False
Hs-Source-Dirs: exec
Main-Is: Main.hs
Expand Down
2 changes: 1 addition & 1 deletion dhall-nixpkgs/dhall-nixpkgs.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Build-Type: Simple

Executable dhall-to-nixpkgs
Main-Is: Main.hs
Build-Depends: base >= 4.10 && < 5
Build-Depends: base >= 4.11 && < 5
, aeson >= 1.0.0.0 && < 1.5
, data-fix
, dhall >= 1.32.0 && < 1.34
Expand Down
Loading

0 comments on commit c3f6c40

Please sign in to comment.