Commit f87738df authored by Herbert Valerio Riedel's avatar Herbert Valerio Riedel 🕺 Committed by GitHub
Browse files

Update default-language & avoid default-extensions (#3880)

This upgrades the `default-language: Haskell98` to `Haskell2010`
and removes `default-extensions: RankNTypes, FlexibleContexts`
in favor of adding `LANGUAGE` pragmas where needed.

Moroever, this also drops `LANGUAGE` pragmas which have become redundant
due to `Haskell2010` (specifically, `EmptyDataDecls`,
`ForeignFunctionInterface` and `PatternGuards`)

Finally, an `other-extensions` specification is put in place for the
`Cabal` library component.

This helps loading up files directly in GHCi, such as e.g. `ghci Setup.hs`
without having to specify `-X...` flags.
parent c18974b9
...@@ -432,8 +432,36 @@ library ...@@ -432,8 +432,36 @@ library
Distribution.Compat.Binary.Class Distribution.Compat.Binary.Class
Distribution.Compat.Binary.Generic Distribution.Compat.Binary.Generic
default-language: Haskell98 default-language: Haskell2010
default-extensions: Rank2Types, FlexibleContexts other-extensions:
BangPatterns
CPP
DefaultSignatures
DeriveDataTypeable
DeriveFoldable
DeriveFunctor
DeriveGeneric
DeriveTraversable
ExistentialQuantification
FlexibleContexts
FlexibleInstances
GeneralizedNewtypeDeriving
ImplicitParams
KindSignatures
NondecreasingIndentation
OverloadedStrings
RankNTypes
RecordWildCards
ScopedTypeVariables
StandaloneDeriving
Trustworthy
TypeFamilies
TypeOperators
TypeSynonymInstances
UndecidableInstances
if impl(ghc >= 7.11)
other-extensions: PatternSynonyms
-- Small, fast running tests. -- Small, fast running tests.
test-suite unit-tests test-suite unit-tests
...@@ -466,7 +494,7 @@ test-suite unit-tests ...@@ -466,7 +494,7 @@ test-suite unit-tests
QuickCheck >= 2.7 && < 2.10, QuickCheck >= 2.7 && < 2.10,
Cabal Cabal
ghc-options: -Wall ghc-options: -Wall
default-language: Haskell98 default-language: Haskell2010
-- Large, system tests that build packages. -- Large, system tests that build packages.
test-suite package-tests test-suite package-tests
...@@ -501,4 +529,4 @@ test-suite package-tests ...@@ -501,4 +529,4 @@ test-suite package-tests
build-depends: unix, exceptions build-depends: unix, exceptions
ghc-options: -Wall -rtsopts ghc-options: -Wall -rtsopts
default-extensions: CPP default-extensions: CPP
default-language: Haskell98 default-language: Haskell2010
{-# LANGUAGE CPP, ForeignFunctionInterface #-} {-# LANGUAGE CPP #-}
{-# LANGUAGE FlexibleContexts #-}
module Distribution.Compat.CreatePipe (createPipe) where module Distribution.Compat.CreatePipe (createPipe) where
import System.IO (Handle, hSetEncoding, localeEncoding) import System.IO (Handle, hSetEncoding, localeEncoding)
......
{-# LANGUAGE CPP #-} {-# LANGUAGE CPP #-}
{-# LANGUAGE ForeignFunctionInterface #-} {-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE RankNTypes #-}
{-# OPTIONS_HADDOCK hide #-} {-# OPTIONS_HADDOCK hide #-}
module Distribution.Compat.Environment module Distribution.Compat.Environment
......
{-# LANGUAGE CPP, ForeignFunctionInterface #-} {-# LANGUAGE CPP #-}
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
-- | -- |
......
{-# LANGUAGE CPP #-} {-# LANGUAGE CPP #-}
{-# LANGUAGE TypeOperators #-} {-# LANGUAGE TypeOperators #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE FlexibleContexts #-}
#ifdef MIN_VERSION_base #ifdef MIN_VERSION_base
#define MINVER_base_48 MIN_VERSION_base(4,8,0) #define MINVER_base_48 MIN_VERSION_base(4,8,0)
......
{-# LANGUAGE CPP #-} {-# LANGUAGE CPP #-}
{-# LANGUAGE Rank2Types #-} {-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ImplicitParams #-} {-# LANGUAGE ImplicitParams #-}
module Distribution.Compat.Stack ( module Distribution.Compat.Stack (
WithCallStack, WithCallStack,
......
{-# LANGUAGE CPP, ForeignFunctionInterface, GeneralizedNewtypeDeriving, ScopedTypeVariables #-} {-# LANGUAGE CPP #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Distribution.Compat.Time module Distribution.Compat.Time
( ModTime(..) -- Needed for testing ( ModTime(..) -- Needed for testing
, getModTime, getFileAge, getCurTime , getModTime, getFileAge, getCurTime
......
{-# LANGUAGE PatternGuards #-}
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
-- | -- |
-- Module : Distribution.Lex -- Module : Distribution.Lex
......
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE RankNTypes #-}
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
-- | -- |
-- Module : Distribution.Make -- Module : Distribution.Make
......
{-# LANGUAGE CPP #-}
-- -fno-warn-deprecations for use of Map.foldWithKey -- -fno-warn-deprecations for use of Map.foldWithKey
{-# OPTIONS_GHC -fno-warn-deprecations #-} {-# OPTIONS_GHC -fno-warn-deprecations #-}
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
......
{-# LANGUAGE CPP #-} {-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE RankNTypes #-}
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
-- | -- |
-- Module : Distribution.PackageDescription.Parse -- Module : Distribution.PackageDescription.Parse
......
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE RankNTypes #-}
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
-- | -- |
-- Module : Distribution.Simple -- Module : Distribution.Simple
......
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE RankNTypes #-}
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
-- | -- |
-- Module : Distribution.Simple.Bench -- Module : Distribution.Simple.Bench
......
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE RankNTypes #-}
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
-- | -- |
-- Module : Distribution.Simple.Build -- Module : Distribution.Simple.Build
......
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE RankNTypes #-}
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
-- | -- |
-- Module : Distribution.Client.BuildTargets -- Module : Distribution.Client.BuildTargets
......
{-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE RankNTypes #-}
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
-- | -- |
-- Module : Distribution.Simple.Command -- Module : Distribution.Simple.Command
......
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE RecordWildCards #-} {-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE PatternGuards #-}
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
-- | -- |
......
{-# LANGUAGE PatternGuards #-} {-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE RankNTypes #-}
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
-- | -- |
......
{-# LANGUAGE PatternGuards #-} {-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE RankNTypes #-}
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
-- | -- |
-- Module : Distribution.Simple.GHC.Internal -- Module : Distribution.Simple.GHC.Internal
......
{-# LANGUAGE PatternGuards #-} {-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE RankNTypes #-}
module Distribution.Simple.GHCJS ( module Distribution.Simple.GHCJS (
configure, getInstalledPackages, getPackageDBContents, configure, getInstalledPackages, getPackageDBContents,
buildLib, buildExe, buildLib, buildExe,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment