haskell-src-exts-simple 1.18.0.1.1 → 1.19.0.0
raw patch · 4 files changed
+21/−5 lines, 4 filesdep ~haskell-src-extsPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: haskell-src-exts
API changes (from Hackage documentation)
- Language.Haskell.Exts.Simple.Syntax: importAs :: ImportDecl -> Maybe ModuleName
- Language.Haskell.Exts.Simple.Syntax: importModule :: ImportDecl -> ModuleName
- Language.Haskell.Exts.Simple.Syntax: importPkg :: ImportDecl -> Maybe String
- Language.Haskell.Exts.Simple.Syntax: importQualified :: ImportDecl -> Bool
- Language.Haskell.Exts.Simple.Syntax: importSafe :: ImportDecl -> Bool
- Language.Haskell.Exts.Simple.Syntax: importSpecs :: ImportDecl -> Maybe ImportSpecList
- Language.Haskell.Exts.Simple.Syntax: importSrc :: ImportDecl -> Bool
Files
- CHANGELOG.md +5/−0
- README.md +4/−0
- haskell-src-exts-simple.cabal +2/−2
- src/Language/Haskell/Exts/Simple/Syntax.hs +10/−3
CHANGELOG.md view
@@ -1,5 +1,10 @@ # Revision history for haskell-src-exts-simple +## 1.19.0.0 -- 2016-11-20++* support haskell-src-exts 1.19.0+* implement `Language.Haskell.Exts.Simple.Syntax.ImportDecl` as a record pattern synonym for ghc-8.0+ ## 1.18.0.1.1 -- 2016-08-05 * package description should now look fine on hackage
README.md view
@@ -50,3 +50,7 @@ explicitly bidirectional pattern synonyms for literals. For ghc-7.8 compatibility, you should use the `*L` (`intL` etc.) functions for constructing `Literal` values.+* Support for record pattern synonyms was added in ghc-8.0. Therefore,+ with ghc-7.10 and earlier, the constructor of the+ `Language.Haskell.Exts.Simple.Syntax.ImportDecl` type is exported as+ a plain constructor, and the selectors as functions.
haskell-src-exts-simple.cabal view
@@ -1,5 +1,5 @@ name: haskell-src-exts-simple-version: 1.18.0.1.1+version: 1.19.0.0 synopsis: A simplified view on the haskell-src-exts AST description: This package provides a shim for haskell-src-exts (HSE), exposing the@@ -39,6 +39,6 @@ ScopedTypeVariables build-depends: base >= 4.7 && < 5,- haskell-src-exts >= 1.18 && < 1.19+ haskell-src-exts >= 1.18 && < 1.20 hs-source-dirs: src default-language: Haskell2010
src/Language/Haskell/Exts/Simple/Syntax.hs view
@@ -15,8 +15,10 @@ -- -- This works nicely for all datatypes with two exception: ----- * `ImportDecl` has a record constructor, which is currently not supported--- (support exists in ghc-8.0 but is not used by this module yet)+-- * `ImportDecl` has a record constructor. Record type synonyms are only+-- supported ghc-8.0 and later, so for ghc-7.10 and earlier, the+-- constructor is exported as a plain constructor, and the record fields+-- as function. -- * `Literal` has constructors with an extra `String` argument that is not -- used by `Language.Haskell.Exts.Simple.Pretty`. This module uses explicitly -- bidirectional pattern synonyms to support this type, but support for that@@ -116,7 +118,8 @@ -- ** `H.ImportDecl` type ImportDecl = H.ImportDecl ()--- | Note, this is originally a record constructor, but ghc-7.10 does not support record pattern synonyms. For now, the selectors are exported as functions.+-- | Note, this is originally a record constructor, and we use a pattern record synonym for ghc-8.0. But for earlier ghc versions, `ImportDecl` is a plain pattern synonym, and the selectors are exported as functions.+#if __GLASGOW_HASKELL__ < 800 pattern ImportDecl a b c d e f g = H.ImportDecl () (a :: ModuleName) (b :: Bool) (c :: Bool) (d :: Bool) (e :: Maybe String) (f :: Maybe ModuleName) (g :: Maybe ImportSpecList) :: ImportDecl importModule :: ImportDecl -> ModuleName importModule = H.importModule@@ -132,6 +135,10 @@ importAs = H.importAs importSpecs :: ImportDecl -> Maybe ImportSpecList importSpecs = H.importSpecs+#else+pattern ImportDecl { importModule, importQualified, importSrc, importSafe, importPkg, importAs, importSpecs } =+ H.ImportDecl () importModule importQualified importSrc importSafe importPkg importAs importSpecs :: ImportDecl+#endif -- ** `H.ImportSpecList` type ImportSpecList = H.ImportSpecList ()