summaryrefslogtreecommitdiff
path: root/libraries/ghc-boot
diff options
context:
space:
mode:
authorBen Gamari <bgamari.foss@gmail.com>2016-05-16 15:21:34 +0200
committerBen Gamari <ben@smart-cactus.org>2016-05-16 16:22:05 +0200
commiteed820b672e6c3d23106cd151b1e31ce29326e32 (patch)
tree48fd270edef8f7a50ef28f876b0d5e6a47e6313c /libraries/ghc-boot
parentd78faa135921dfe7a6b92f908171af1a2cdce512 (diff)
downloadhaskell-eed820b672e6c3d23106cd151b1e31ce29326e32.tar.gz
Move Extension type to ghc-boot-th
This creates a new package, `ghc-boot-th`, to contain the `Extension` type, which now lives in `GHC.LanguageExtension.Type`. This ensures that the transitive dependency set of the `template-haskell` package remains minimal. The `GHC.LanguageExtensions.Type` module is also re-exported by `ghc-boot`, which provides an orphan `binary` instance as well. Test Plan: Validate Reviewers: goldfire, thomie, hvr, austin Reviewed By: thomie Subscribers: RyanGlScott, thomie, erikd, ezyang Differential Revision: https://phabricator.haskell.org/D2224
Diffstat (limited to 'libraries/ghc-boot')
-rw-r--r--libraries/ghc-boot/GHC/LanguageExtensions.hs135
-rw-r--r--libraries/ghc-boot/GHC/Lexeme.hs32
-rw-r--r--libraries/ghc-boot/changelog.md2
-rw-r--r--libraries/ghc-boot/ghc-boot.cabal.in13
4 files changed, 20 insertions, 162 deletions
diff --git a/libraries/ghc-boot/GHC/LanguageExtensions.hs b/libraries/ghc-boot/GHC/LanguageExtensions.hs
index 7add46e194..13c3ec5208 100644
--- a/libraries/ghc-boot/GHC/LanguageExtensions.hs
+++ b/libraries/ghc-boot/GHC/LanguageExtensions.hs
@@ -1,130 +1,17 @@
------------------------------------------------------------------------------
--- |
--- Module : GHC.LanguageExtensions
--- Copyright : (c) The GHC Team
---
--- Maintainer : ghc-devs@haskell.org
--- Portability : portable
+{-# OPTIONS_GHC -fno-warn-orphans #-}
+
+-- | This module re-exports the 'Extension' type along with an orphan 'Binary'
+-- instance for it.
--
--- A data type defining the language extensions supported by GHC.
+-- Note that the @ghc-boot@ package has a large set of dependencies; for this
+-- reason the 'Extension' type itself is defined in the
+-- "GHC.LanguageExtensions.Type" module provided by the @ghc-boot-th@ package,
+-- which has no dependencies outside of @base@. For this reason
+-- @template-haskell@ depends upon @ghc-boot-th@, not @ghc-boot@.
--
-{-# LANGUAGE DeriveGeneric #-}
-module GHC.LanguageExtensions ( Extension(..) ) where
+module GHC.LanguageExtensions ( module GHC.LanguageExtensions.Type ) where
-import GHC.Generics
import Data.Binary
-
--- | The language extensions known to GHC.
-data Extension
--- See Note [Updating flag description in the User's Guide] in DynFlags
- = Cpp
- | OverlappingInstances
- | UndecidableInstances
- | IncoherentInstances
- | UndecidableSuperClasses
- | MonomorphismRestriction
- | MonoPatBinds
- | MonoLocalBinds
- | RelaxedPolyRec -- Deprecated
- | ExtendedDefaultRules -- Use GHC's extended rules for defaulting
- | ForeignFunctionInterface
- | UnliftedFFITypes
- | InterruptibleFFI
- | CApiFFI
- | GHCForeignImportPrim
- | JavaScriptFFI
- | ParallelArrays -- Syntactic support for parallel arrays
- | Arrows -- Arrow-notation syntax
- | TemplateHaskell
- | TemplateHaskellQuotes -- subset of TH supported by stage1, no splice
- | QuasiQuotes
- | ImplicitParams
- | ImplicitPrelude
- | ScopedTypeVariables
- | AllowAmbiguousTypes
- | UnboxedTuples
- | BangPatterns
- | TypeFamilies
- | TypeFamilyDependencies
- | TypeInType
- | OverloadedStrings
- | OverloadedLists
- | NumDecimals
- | DisambiguateRecordFields
- | RecordWildCards
- | RecordPuns
- | ViewPatterns
- | GADTs
- | GADTSyntax
- | NPlusKPatterns
- | DoAndIfThenElse
- | RebindableSyntax
- | ConstraintKinds
- | PolyKinds -- Kind polymorphism
- | DataKinds -- Datatype promotion
- | InstanceSigs
- | ApplicativeDo
-
- | StandaloneDeriving
- | DeriveDataTypeable
- | AutoDeriveTypeable -- Automatic derivation of Typeable
- | DeriveFunctor
- | DeriveTraversable
- | DeriveFoldable
- | DeriveGeneric -- Allow deriving Generic/1
- | DefaultSignatures -- Allow extra signatures for defmeths
- | DeriveAnyClass -- Allow deriving any class
- | DeriveLift -- Allow deriving Lift
-
- | TypeSynonymInstances
- | FlexibleContexts
- | FlexibleInstances
- | ConstrainedClassMethods
- | MultiParamTypeClasses
- | NullaryTypeClasses
- | FunctionalDependencies
- | UnicodeSyntax
- | ExistentialQuantification
- | MagicHash
- | EmptyDataDecls
- | KindSignatures
- | RoleAnnotations
- | ParallelListComp
- | TransformListComp
- | MonadComprehensions
- | GeneralizedNewtypeDeriving
- | RecursiveDo
- | PostfixOperators
- | TupleSections
- | PatternGuards
- | LiberalTypeSynonyms
- | RankNTypes
- | ImpredicativeTypes
- | TypeOperators
- | ExplicitNamespaces
- | PackageImports
- | ExplicitForAll
- | AlternativeLayoutRule
- | AlternativeLayoutRuleTransitional
- | DatatypeContexts
- | NondecreasingIndentation
- | RelaxedLayout
- | TraditionalRecordSyntax
- | LambdaCase
- | MultiWayIf
- | BinaryLiterals
- | NegativeLiterals
- | DuplicateRecordFields
- | OverloadedLabels
- | EmptyCase
- | PatternSynonyms
- | PartialTypeSignatures
- | NamedWildCards
- | StaticPointers
- | TypeApplications
- | Strict
- | StrictData
- | MonadFailDesugaring
- deriving (Eq, Enum, Show, Generic)
+import GHC.LanguageExtensions.Type
instance Binary Extension
diff --git a/libraries/ghc-boot/GHC/Lexeme.hs b/libraries/ghc-boot/GHC/Lexeme.hs
deleted file mode 100644
index 677c9a65e6..0000000000
--- a/libraries/ghc-boot/GHC/Lexeme.hs
+++ /dev/null
@@ -1,32 +0,0 @@
------------------------------------------------------------------------------
--- |
--- Module : GHC.Lexeme
--- Copyright : (c) The GHC Team
---
--- Maintainer : ghc-devs@haskell.org
--- Portability : portable
---
--- Functions to evaluate whether or not a string is a valid identifier.
---
-module GHC.Lexeme (
- -- * Lexical characteristics of Haskell names
- startsVarSym, startsVarId, startsConSym, startsConId,
- startsVarSymASCII, isVarSymChar
- ) where
-
-import Data.Char
-
-startsVarSym, startsVarId, startsConSym, startsConId :: Char -> Bool
-startsVarSym c = startsVarSymASCII c || (ord c > 0x7f && isSymbol c) -- Infix Ids
-startsConSym c = c == ':' -- Infix data constructors
-startsVarId c = c == '_' || case generalCategory c of -- Ordinary Ids
- LowercaseLetter -> True
- OtherLetter -> True -- See #1103
- _ -> False
-startsConId c = isUpper c || c == '(' -- Ordinary type constructors and data constructors
-
-startsVarSymASCII :: Char -> Bool
-startsVarSymASCII c = c `elem` "!#$%&*+./<=>?@\\^|~-"
-
-isVarSymChar :: Char -> Bool
-isVarSymChar c = c == ':' || startsVarSym c
diff --git a/libraries/ghc-boot/changelog.md b/libraries/ghc-boot/changelog.md
index e0b4d69aa7..3ed5bbbfd2 100644
--- a/libraries/ghc-boot/changelog.md
+++ b/libraries/ghc-boot/changelog.md
@@ -1,4 +1,4 @@
-## 0.0.0.0 *Feb 2016*
+## 8.0.1 *May 2016*
* Bundled with GHC 8.0.1
diff --git a/libraries/ghc-boot/ghc-boot.cabal.in b/libraries/ghc-boot/ghc-boot.cabal.in
index b7d3955190..eed11e3b43 100644
--- a/libraries/ghc-boot/ghc-boot.cabal.in
+++ b/libraries/ghc-boot/ghc-boot.cabal.in
@@ -22,7 +22,7 @@ description: This library is shared between GHC, ghc-pkg, and other boot
The package database format and this library are constructed in
such a way that while ghc-pkg depends on Cabal, the GHC library
and program do not have to depend on Cabal.
-cabal-version: >=1.10
+cabal-version: >=1.22
build-type: Simple
extra-source-files: changelog.md
@@ -36,14 +36,17 @@ Library
other-extensions: DeriveGeneric, RankNTypes, ScopedTypeVariables
exposed-modules:
- GHC.Lexeme
- GHC.PackageDb
GHC.LanguageExtensions
+ GHC.PackageDb
GHC.Serialized
+ reexported-modules:
+ GHC.LanguageExtensions.Type,
+ GHC.Lexeme
+
build-depends: base >= 4.7 && < 4.10,
binary == 0.8.*,
bytestring == 0.10.*,
directory == 1.2.*,
- filepath >= 1.3 && < 1.5
-
+ filepath >= 1.3 && < 1.5,
+ ghc-boot-th == @ProjectVersionMunged@