haskell-src-exts-simple 1.21.1.0 → 1.23.1.0
raw patch · 6 files changed
Files
- CHANGELOG.md +21/−7
- README.md +1/−11
- haskell-src-exts-simple.cabal +4/−4
- src/Language/Haskell/Exts/Simple.hs +4/−0
- src/Language/Haskell/Exts/Simple/Parser.hs +19/−12
- src/Language/Haskell/Exts/Simple/Syntax.hs +328/−49
CHANGELOG.md view
@@ -1,30 +1,44 @@ # Revision history for haskell-src-exts-simple -## 1.21.0.1 -- 2019-09-13+## 1.23.1.0 - 2024-12-27 +* add COMPLETE pragmas (courtesy of @ratherforky)++## 1.23.0.0 — 2020-03-13++* support haskell-src-exts 1.23.0++## 1.22.0.0 — 2019-11-05++* support haskell-src-exts 1.22.0+* clean up mentions of ghc < 8++## 1.21.1.0 — 2019-09-13+ * support haskell-src-exts 1.21.1+* require base >= 4.9 (and, consequently, ghc >= 8) -## 1.21.0.0 -- 2019-04-27+## 1.21.0.0 — 2019-04-27 * support haskell-src-exts 1.21.0 -## 1.20.0.0 -- 2017-12-??+## 1.20.0.0 — 2017-12-26 * support haskell-src-exts 1.20.0 -## 1.19.0.0 -- 2016-11-20+## 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+## 1.18.0.1.1 — 2016-08-05 * package description should now look fine on hackage -## 1.18.0.1 -- 2016-08-02+## 1.18.0.1 — 2016-08-02 * ghc-7.8 compatibility (see COMPATIBILITY.md for caveats) -## 1.18.0 -- 2016-07-31+## 1.18.0 — 2016-07-31 * Initial release.
README.md view
@@ -46,14 +46,4 @@ ### ghc compatibility -* haskell-src-exts-simple requires ghc-7.8 or later-* Note that with ghc-7.8, the constructors of the- `Language.Haskell.Exts.Simple.Syntax.Literal` type are only- available for pattern matching, because construction relies on- 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 requires ghc-8.0 or later
haskell-src-exts-simple.cabal view
@@ -1,5 +1,5 @@ name: haskell-src-exts-simple-version: 1.21.1.0+version: 1.23.1.0 synopsis: A simplified view on the haskell-src-exts AST description: This package provides a shim for haskell-src-exts (HSE), exposing the@@ -10,7 +10,7 @@ license-file: LICENSE author: Bertram Felgenhauer maintainer: Bertram Felgenhauer <int-e@gmx.de>-copyright: 2016, Bertram Felgenhauer+copyright: 2016-2024, Bertram Felgenhauer category: Development build-type: Simple extra-source-files:@@ -38,7 +38,7 @@ PatternSynonyms, ScopedTypeVariables build-depends:- base >= 4.7 && < 5,- haskell-src-exts >= 1.21 && < 1.22+ base >= 4.9 && < 5,+ haskell-src-exts >= 1.23 && < 1.24 hs-source-dirs: src default-language: Haskell2010
src/Language/Haskell/Exts/Simple.hs view
@@ -51,3 +51,7 @@ parseFileContentsWithMode :: ParseMode -> String -> ParseResult Module parseFileContentsWithMode m = fmap (fmap (const ())) . H.parseFileContentsWithMode m++-- omitted: parseFileWithComments :: ParseMode -> FilePath -> IO (ParseResult (Module, [Comment]))+-- omitted: parseFileWithCommentsAndPragmas :: ParseMode -> FilePath -> IO (ParseResult (Module, [Comment], [UnknownPragma]))+-- omitted: parseFileContentsWithComments :: ParseMode -> String -> ParseResult (Module, [Comment])
src/Language/Haskell/Exts/Simple/Parser.hs view
@@ -3,9 +3,6 @@ {-# LANGUAGE ScopedTypeVariables #-} -- | -- This module partially reexports "Language.Haskell.Exts.Parser" with adaptations.------ __IMPORTANT__: if you require compatiblity with ghc 7.8, you should use the--- function `listOf` for constructing `ListOf` values! module Language.Haskell.Exts.Simple.Parser ( module Language.Haskell.Exts.Simple.Parser,@@ -31,33 +28,40 @@ -- * Datatypes and Constructors -- ** `H.ListOf`--- | Beware that the `ListOf` constructor only works in a pattern context--- in ghc-7.8, because that version does not support explicitly bidirectional--- pattern synonyms.------ For code that needs to work with ghc-7.8, we provide the `listOf` function--- constructing `ListOf` values.- type ListOf = H.ListOf pattern ListOf a <- H.ListOf _ a-#if __GLASGOW_HASKELL__ > 708 where ListOf a = listOf a-#endif listOf :: [a] -> ListOf a listOf a = H.ListOf H.noSrcSpan a +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE ListOf #-}+#endif+ -- ** `H.PragmasAndModuleName` type PragmasAndModuleName = H.PragmasAndModuleName () pattern PragmasAndModuleName a b = H.PragmasAndModuleName () (a :: [ModulePragma]) (b :: Maybe ModuleName) :: PragmasAndModuleName +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE PragmasAndModuleName #-}+#endif+ -- ** `H.PragmasAndModuleHead` type PragmasAndModuleHead = H.PragmasAndModuleHead () pattern PragmasAndModuleHead a b = H.PragmasAndModuleHead () (a :: [ModulePragma]) (b :: Maybe ModuleHead) +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE PragmasAndModuleHead #-}+#endif+ -- ** `H.ModuleHeadAndImports` type ModuleHeadAndImports = H.ModuleHeadAndImports () pattern ModuleHeadAndImports a b c = H.ModuleHeadAndImports () (a :: [ModulePragma]) (b :: Maybe ModuleHead) (c :: [ImportDecl]) +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE ModuleHeadAndImports #-}+#endif+ -- * Functions parse :: (Parseable (ast H.SrcSpanInfo), Functor ast) => String -> ParseResult (ast ())@@ -65,6 +69,9 @@ parseWithMode :: (Parseable (ast H.SrcSpanInfo), Functor ast) => ParseMode -> String -> ParseResult (ast ()) parseWithMode m = fmap (fmap (const () :: H.SrcSpanInfo -> ())) . H.parseWithMode m++parseWithComments :: (Parseable (ast H.SrcSpanInfo), Functor ast) => ParseMode -> String -> ParseResult (ast (), [Comment])+parseWithComments m = fmap (first (fmap (const () :: H.SrcSpanInfo -> ()))) . H.parseWithComments m parseModule :: String -> ParseResult Module parseModule = fmap (fmap (const ())) . H.parseModule
src/Language/Haskell/Exts/Simple/Syntax.hs view
@@ -12,20 +12,6 @@ -- > type Name = H.Name () -- > pattern Ident a = H.Ident () a -- > pattern Symbol a = H.Symbol () a------ This works nicely for all datatypes with two exception:------ * `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--- is only available in ghc-7.10 and later.------ __IMPORTANT__: if you require compatiblity with ghc 7.8, you should use the--- functions `charL`, `stringL` etc. for constructing `Literal` values! module Language.Haskell.Exts.Simple.Syntax ( module Language.Haskell.Exts.Simple.Syntax,@@ -44,6 +30,10 @@ type ModuleName = H.ModuleName () pattern ModuleName a = H.ModuleName () (a :: String) :: ModuleName +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE ModuleName #-}+#endif+ -- ** `H.SpecialCon` type SpecialCon = H.SpecialCon () pattern UnitCon = H.UnitCon () :: SpecialCon@@ -54,51 +44,91 @@ pattern UnboxedSingleCon = H.UnboxedSingleCon () :: SpecialCon pattern ExprHole = H.ExprHole () :: SpecialCon +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE UnitCon, ListCon, FunCon, TupleCon, Cons, UnboxedSingleCon, ExprHole #-}+#endif+ -- ** `H.QName` type QName = H.QName () pattern Qual a b = H.Qual () (a :: ModuleName) (b :: Name) :: QName pattern UnQual a = H.UnQual () (a :: Name) :: QName pattern Special a = H.Special () (a :: SpecialCon) :: QName +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE Qual, UnQual, Special #-}+#endif+ -- ** `H.Name` type Name = H.Name () pattern Ident a = H.Ident () (a :: String) :: Name pattern Symbol a = H.Symbol () (a :: String) :: Name +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE Ident, Symbol #-}+#endif+ -- ** `H.IPName` type IPName = H.IPName () pattern IPDup a = H.IPDup () (a :: String) :: IPName pattern IPLin a = H.IPLin () (a :: String) :: IPName +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE IPDup, IPLin #-}+#endif+ -- ** `H.QOp` type QOp = H.QOp () pattern QVarOp a = H.QVarOp () (a :: QName) :: QOp pattern QConOp a = H.QConOp () (a :: QName) :: QOp +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE QVarOp, QConOp #-}+#endif+ -- ** `H.Op` type Op = H.Op () pattern VarOp a = H.VarOp () (a :: Name) :: Op pattern ConOp a = H.ConOp () (a :: Name) :: Op +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE VarOp, ConOp #-}+#endif+ -- ** `H.CName` type CName = H.CName () pattern VarName a = H.VarName () (a :: Name) :: CName pattern ConName a = H.ConName () (a :: Name) :: CName +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE VarName, ConName #-}+#endif+ -- ** `H.Module` type Module = H.Module () pattern Module a b c d = H.Module () (a :: (Maybe ModuleHead)) (b :: [ModulePragma]) (c :: [ImportDecl]) (d :: [Decl]) :: Module pattern XmlPage a b c d e f = H.XmlPage () (a :: ModuleName) (b :: [ModulePragma]) (c :: XName) (d :: [XAttr]) (e :: (Maybe Exp)) (f :: [Exp]) :: Module pattern XmlHybrid a b c d e f g h = H.XmlHybrid () (a :: (Maybe ModuleHead)) (b :: [ModulePragma]) (c :: [ImportDecl]) (d :: [Decl]) (e :: XName) (f :: [XAttr]) (g :: (Maybe Exp)) (h :: [Exp]) :: Module +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE Module, XmlPage, XmlHybrid #-}+#endif+ -- ** `H.ModuleHead` type ModuleHead = H.ModuleHead () pattern ModuleHead a b c = H.ModuleHead () (a :: ModuleName) (b :: (Maybe WarningText)) (c :: (Maybe ExportSpecList)) :: ModuleHead +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE ModuleHead #-}+#endif+ -- ** `H.ExportSpecList` type ExportSpecList = H.ExportSpecList () pattern ExportSpecList a = H.ExportSpecList () (a :: [ExportSpec]) :: ExportSpecList +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE ExportSpecList #-}+#endif+ -- ** `H.ExportSpec` type ExportSpec = H.ExportSpec () pattern EVar a = H.EVar () (a :: QName) :: ExportSpec@@ -106,45 +136,46 @@ pattern EThingWith a b c = H.EThingWith () (a :: EWildcard) (b :: QName) (c :: [CName]) :: ExportSpec pattern EModuleContents a = H.EModuleContents () (a :: ModuleName) :: ExportSpec +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE EVar, EAbs, EThingWith, EModuleContents #-}+#endif+ -- ** `H.EWildcard` type EWildcard = H.EWildcard () pattern NoWildcard = H.NoWildcard () :: EWildcard pattern EWildcard a = H.EWildcard () (a :: Int) :: EWildcard +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE NoWildcard, EWildcard #-}+#endif+ -- ** `H.Namespace` type Namespace = H.Namespace () pattern NoNamespace = H.NoNamespace () :: Namespace pattern TypeNamespace = H.TypeNamespace () :: Namespace pattern PatternNamespace = H.PatternNamespace () :: Namespace +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE NoNamespace, TypeNamespace, PatternNamespace #-}+#endif+ -- ** `H.ImportDecl` type ImportDecl = H.ImportDecl ()--- | 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-importQualified :: ImportDecl -> Bool-importQualified = H.importQualified-importSrc :: ImportDecl -> Bool-importSrc = H.importSrc-importSafe :: ImportDecl -> Bool-importSafe = H.importSafe-importPkg :: ImportDecl -> Maybe String-importPkg = H.importPkg-importAs :: ImportDecl -> Maybe ModuleName-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++#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE ImportDecl #-} #endif -- ** `H.ImportSpecList` type ImportSpecList = H.ImportSpecList () pattern ImportSpecList a b = H.ImportSpecList () (a :: Bool) (b :: [ImportSpec]) :: ImportSpecList +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE ImportSpecList #-}+#endif+ -- ** `H.ImportSpec` type ImportSpec = H.ImportSpec () pattern IVar a = H.IVar () (a :: Name) :: ImportSpec@@ -152,12 +183,20 @@ pattern IThingAll a = H.IThingAll () (a :: Name) :: ImportSpec pattern IThingWith a b = H.IThingWith () (a :: Name) (b :: [CName]) :: ImportSpec +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE IVar, IAbs, IThingAll, IThingWith #-}+#endif+ -- ** `H.Assoc` type Assoc = H.Assoc () pattern AssocNone = H.AssocNone () :: Assoc pattern AssocLeft = H.AssocLeft () :: Assoc pattern AssocRight = H.AssocRight () :: Assoc +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE AssocNone, AssocLeft, AssocRight #-}+#endif+ -- ** `H.Decl` type Decl = H.Decl () pattern TypeDecl a b = H.TypeDecl () (a :: DeclHead) (b :: Type) :: Decl@@ -175,6 +214,7 @@ pattern InfixDecl a b c = H.InfixDecl () (a :: Assoc) (b :: (Maybe Int)) (c :: [Op]) :: Decl pattern DefaultDecl a = H.DefaultDecl () (a :: [Type]) :: Decl pattern SpliceDecl a = H.SpliceDecl () (a :: Exp) :: Decl+pattern TSpliceDecl a = H.TSpliceDecl () (a :: Exp) :: Decl pattern TypeSig a b = H.TypeSig () (a :: [Name]) (b :: Type) :: Decl pattern PatSynSig a b c d e f = H.PatSynSig () (a :: [Name]) (b :: (Maybe [TyVarBind])) (c :: (Maybe Context)) (d :: (Maybe [TyVarBind])) (e :: (Maybe Context)) (f :: Type) :: Decl pattern FunBind a = H.FunBind () (a :: [Match]) :: Decl@@ -195,22 +235,44 @@ pattern RoleAnnotDecl a b = H.RoleAnnotDecl () (a :: QName) (b :: [Role]) :: Decl pattern CompletePragma a b = H.CompletePragma () (a :: [Name]) (b :: (Maybe QName)) :: Decl +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE TypeDecl, TypeFamDecl, ClosedTypeFamDecl, DataDecl, GDataDecl,+ DataFamDecl, TypeInsDecl, DataInsDecl, GDataInsDecl, ClassDecl, InstDecl,+ DerivDecl, InfixDecl, DefaultDecl, SpliceDecl, TSpliceDecl, TypeSig,+ PatSynSig, FunBind, PatBind, PatSyn, ForImp, ForExp, RulePragmaDecl,+ DeprPragmaDecl, WarnPragmaDecl, InlineSig, InlineConlikeSig, SpecSig,+ SpecInlineSig, InstSig, AnnPragma, MinimalPragma, RoleAnnotDecl,+ CompletePragma #-}+#endif+ -- ** `H.PatternSynDirection` type PatternSynDirection = H.PatternSynDirection () pattern Unidirectional = H.Unidirectional :: PatternSynDirection pattern ImplicitBidirectional = H.ImplicitBidirectional :: PatternSynDirection pattern ExplicitBidirectional a = H.ExplicitBidirectional () (a :: [Decl]) :: PatternSynDirection +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE Unidirectional, ImplicitBidirectional, ExplicitBidirectional #-}+#endif+ -- ** `H.TypeEqn` type TypeEqn = H.TypeEqn () pattern TypeEqn a b = H.TypeEqn () (a :: Type) (b :: Type) :: TypeEqn +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE TypeEqn #-}+#endif+ -- ** `H.Annotation` type Annotation = H.Annotation () pattern Ann a b = H.Ann () (a :: Name) (b :: Exp) :: Annotation pattern TypeAnn a b = H.TypeAnn () (a :: Name) (b :: Exp) :: Annotation pattern ModuleAnn a = H.ModuleAnn () (a :: Exp) :: Annotation +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE Ann, TypeAnn, ModuleAnn #-}+#endif+ -- ** `H.BooleanFormula` type BooleanFormula = H.BooleanFormula () pattern VarFormula a = H.VarFormula () (a :: Name) :: BooleanFormula@@ -218,6 +280,10 @@ pattern OrFormula a = H.OrFormula () (a :: [BooleanFormula]) :: BooleanFormula pattern ParenFormula a = H.ParenFormula () (a :: BooleanFormula) :: BooleanFormula +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE VarFormula, AndFormula, OrFormula, ParenFormula #-}+#endif+ -- ** `H.Role` type Role = H.Role () pattern Nominal = H.Nominal () :: Role@@ -225,20 +291,36 @@ pattern Phantom = H.Phantom () :: Role pattern RoleWildcard = H.RoleWildcard () :: Role +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE Nominal, Representational, Phantom, RoleWildcard #-}+#endif+ -- ** `H.DataOrNew` type DataOrNew = H.DataOrNew () pattern DataType = H.DataType () :: DataOrNew pattern NewType = H.NewType () :: DataOrNew +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE DataType, NewType #-}+#endif+ -- ** `H.InjectivityInfo` type InjectivityInfo = H.InjectivityInfo () pattern InjectivityInfo a b = H.InjectivityInfo () (a :: Name) (b :: [Name]) :: InjectivityInfo +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE InjectivityInfo #-}+#endif+ -- ** `H.ResultSig` type ResultSig = H.ResultSig () pattern KindSig a = H.KindSig () (a :: Kind) :: ResultSig pattern TyVarSig a = H.TyVarSig () (a :: TyVarBind) :: ResultSig +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE KindSig, TyVarSig #-}+#endif+ -- ** `H.DeclHead` type DeclHead = H.DeclHead () pattern DHead a = H.DHead () (a :: Name) :: DeclHead@@ -246,11 +328,19 @@ pattern DHParen a = H.DHParen () (a :: DeclHead) :: DeclHead pattern DHApp a b = H.DHApp () (a :: DeclHead) (b :: TyVarBind) :: DeclHead +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE DHead, DHInfix, DHParen, DHApp #-}+#endif+ -- ** `H.InstRule` type InstRule = H.InstRule () pattern IRule a b c = H.IRule () (a :: (Maybe [TyVarBind])) (b :: (Maybe Context)) (c :: InstHead) :: InstRule pattern IParen a = H.IParen () (a :: InstRule) :: InstRule +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE IRule, IParen #-}+#endif+ -- ** `H.InstHead` type InstHead = H.InstHead () pattern IHCon a = H.IHCon () (a :: QName) :: InstHead@@ -258,10 +348,18 @@ pattern IHParen a = H.IHParen () (a :: InstHead) :: InstHead pattern IHApp a b = H.IHApp () (a :: InstHead) (b :: Type) :: InstHead +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE IHCon, IHInfix, IHParen, IHApp #-}+#endif+ -- ** `H.Deriving` type Deriving = H.Deriving () pattern Deriving a b = H.Deriving () (a :: (Maybe DerivStrategy)) (b :: [InstRule]) :: Deriving +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE Deriving #-}+#endif+ -- ** `H.DerivStrategy` type DerivStrategy = H.DerivStrategy () pattern DerivStock = H.DerivStock () :: DerivStrategy@@ -269,38 +367,70 @@ pattern DerivNewtype = H.DerivNewtype () :: DerivStrategy pattern DerivVia a = H.DerivVia () (a :: Type) :: DerivStrategy +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE DerivStock, DerivAnyclass, DerivNewtype, DerivVia #-}+#endif+ -- ** `H.Binds` type Binds = H.Binds () pattern BDecls a = H.BDecls () (a :: [Decl]) :: Binds pattern IPBinds a = H.IPBinds () (a :: [IPBind]) :: Binds +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE BDecls, IPBinds #-}+#endif+ -- ** `H.IPBind` type IPBind = H.IPBind () pattern IPBind a b = H.IPBind () (a :: IPName) (b :: Exp) :: IPBind +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE IPBind #-}+#endif+ -- ** `H.Match` type Match = H.Match () pattern Match a b c d = H.Match () (a :: Name) (b :: [Pat]) (c :: Rhs) (d :: (Maybe Binds)) :: Match pattern InfixMatch a b c d e = H.InfixMatch () (a :: Pat) (b :: Name) (c :: [Pat]) (d :: Rhs) (e :: (Maybe Binds)) :: Match +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE Match, InfixMatch #-}+#endif+ -- ** `H.QualConDecl` type QualConDecl = H.QualConDecl () pattern QualConDecl a b c = H.QualConDecl () (a :: (Maybe [TyVarBind])) (b :: (Maybe Context)) (c :: ConDecl) :: QualConDecl +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE QualConDecl #-}+#endif+ -- ** `H.ConDecl` type ConDecl = H.ConDecl () pattern ConDecl a b = H.ConDecl () (a :: Name) (b :: [Type]) :: ConDecl pattern InfixConDecl a b c = H.InfixConDecl () (a :: Type) (b :: Name) (c :: Type) :: ConDecl pattern RecDecl a b = H.RecDecl () (a :: Name) (b :: [FieldDecl]) :: ConDecl +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE ConDecl, InfixConDecl, RecDecl #-}+#endif+ -- ** `H.FieldDecl` type FieldDecl = H.FieldDecl () pattern FieldDecl a b = H.FieldDecl () (a :: [Name]) (b :: Type) :: FieldDecl +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE FieldDecl #-}+#endif+ -- ** `H.GadtDecl` type GadtDecl = H.GadtDecl () pattern GadtDecl a b c d e = H.GadtDecl () (a :: Name) (b :: (Maybe [TyVarBind])) (c :: (Maybe Context)) (d :: (Maybe [FieldDecl])) (e :: Type) :: GadtDecl +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE GadtDecl #-}+#endif+ -- ** `H.ClassDecl` type ClassDecl = H.ClassDecl () pattern ClsDecl a = H.ClsDecl () (a :: Decl) :: ClassDecl@@ -309,6 +439,10 @@ pattern ClsTyDef a = H.ClsTyDef () (a :: TypeEqn) :: ClassDecl pattern ClsDefSig a b = H.ClsDefSig () (a :: Name) (b :: Type) :: ClassDecl +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE ClsDecl, ClsDataFam, ClsTyFam, ClsTyDef, ClsDefSig #-}+#endif+ -- ** `H.InstDecl` type InstDecl = H.InstDecl () pattern InsDecl a = H.InsDecl () (a :: Decl) :: InstDecl@@ -316,27 +450,47 @@ pattern InsData a b c d = H.InsData () (a :: DataOrNew) (b :: Type) (c :: [QualConDecl]) (d :: [Deriving]) :: InstDecl pattern InsGData a b c d e = H.InsGData () (a :: DataOrNew) (b :: Type) (c :: (Maybe Kind)) (d :: [GadtDecl]) (e :: [Deriving]) :: InstDecl +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE InsDecl, InsType, InsData, InsGData #-}+#endif+ -- ** `H.BangType` type BangType = H.BangType () pattern BangedTy = H.BangedTy () :: BangType pattern LazyTy = H.LazyTy () :: BangType pattern NoStrictAnnot = H.NoStrictAnnot () :: BangType +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE BangedTy, LazyTy, NoStrictAnnot #-}+#endif+ -- ** `H.Unpackedness` type Unpackedness = H.Unpackedness () pattern Unpack = H.Unpack () :: Unpackedness pattern NoUnpack = H.NoUnpack () :: Unpackedness pattern NoUnpackPragma = H.NoUnpackPragma () :: Unpackedness +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE Unpack, NoUnpack, NoUnpackPragma #-}+#endif+ -- ** `H.Rhs` type Rhs = H.Rhs () pattern UnGuardedRhs a = H.UnGuardedRhs () (a :: Exp) :: Rhs pattern GuardedRhss a = H.GuardedRhss () (a :: [GuardedRhs]) :: Rhs +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE UnGuardedRhs, GuardedRhss #-}+#endif+ -- ** `H.GuardedRhs` type GuardedRhs = H.GuardedRhs () pattern GuardedRhs a b = H.GuardedRhs () (a :: [Stmt]) (b :: Exp) :: GuardedRhs +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE GuardedRhs #-}+#endif+ -- ** `H.Type` type Type = H.Type () pattern TyForall a b c = H.TyForall () (a :: (Maybe [TyVarBind])) (b :: (Maybe Context)) (c :: Type) :: Type@@ -359,11 +513,21 @@ pattern TyWildCard a = H.TyWildCard () (a :: (Maybe Name)) :: Type pattern TyQuasiQuote a b = H.TyQuasiQuote () (a :: String) (b :: String) :: Type +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE TyForall, TyStar, TyFun, TyTuple, TyUnboxedSum, TyList, TyParArray, TyApp,+ TyVar, TyCon, TyParen, TyInfix, TyKind, TyPromoted, TyEquals, TySplice,+ TyBang, TyWildCard, TyQuasiQuote #-}+#endif+ -- ** `H.MaybePromotedName` type MaybePromotedName = H.MaybePromotedName () pattern PromotedName a = H.PromotedName () (a :: QName) :: MaybePromotedName pattern UnpromotedName a = H.UnpromotedName () (a :: QName) :: MaybePromotedName +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE PromotedName, UnpromotedName #-}+#endif+ -- ** `H.Promoted` type Promoted = H.Promoted () pattern PromotedInteger a b = H.PromotedInteger () (a :: Integer) (b :: String) :: Promoted@@ -373,6 +537,11 @@ pattern PromotedTuple a = H.PromotedTuple () (a :: [Type]) :: Promoted pattern PromotedUnit = H.PromotedUnit () :: Promoted +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE PromotedInteger, PromotedString, PromotedCon, PromotedList, PromotedTuple,+ PromotedUnit #-}+#endif+ -- skipped: data Boxed -- ** `H.TyVarBind`@@ -380,6 +549,10 @@ pattern KindedVar a b = H.KindedVar () (a :: Name) (b :: Kind) :: TyVarBind pattern UnkindedVar a = H.UnkindedVar () (a :: Name) :: TyVarBind +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE KindedVar, UnkindedVar #-}+#endif+ -- ** `H.Kind` -- | Note that `Kind` is an alias for `Type` since haskell-src-exts-1.21.@@ -389,37 +562,33 @@ type FunDep = H.FunDep () pattern FunDep a b = H.FunDep () (a :: [Name]) (b :: [Name]) :: FunDep +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE FunDep #-}+#endif+ -- ** `H.Context` type Context = H.Context () pattern CxSingle a = H.CxSingle () (a :: Asst) :: Context pattern CxTuple a = H.CxTuple () (a :: [Asst]) :: Context pattern CxEmpty = H.CxEmpty () :: Context +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE CxSingle, CxTuple, CxEmpty #-}+#endif+ -- ** `H.Asst` type Asst = H.Asst ()-pattern ClassA a b = H.ClassA () (a :: QName) (b :: [Type]) :: Asst-pattern AppA a b = H.AppA () (a :: Name) (b :: [Type]) :: Asst-pattern InfixA a b c = H.InfixA () (a :: Type) (b :: QName) (c :: Type) :: Asst+pattern TypeA a = H.TypeA () (a :: Type) :: Asst pattern IParam a b = H.IParam () (a :: IPName) (b :: Type) :: Asst-pattern EqualP a b = H.EqualP () (a :: Type) (b :: Type) :: Asst pattern ParenA a = H.ParenA () (a :: Asst) :: Asst-pattern WildCardA a = H.WildCardA () (a :: (Maybe Name)) :: Asst --- ** `H.Literal`---- | Beware that the constructors only work in a pattern context in ghc-7.8,--- because that version does not support explicitly bidirectional pattern--- synonyms.------ For code that needs to work with ghc-7.8, we provide functions `charL`,--- `stringL`, `intL`, `fracL`, etc. for constructing `Literal` values.+#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE TypeA, IParam, ParenA #-}+#endif +-- ** `H.Literal` type Literal = H.Literal () -#if __GLASGOW_HASKELL__ <= 708-#define where ---#endif- pattern Char a <- H.Char () (a :: Char) _ :: Literal where Char a = H.Char () a [a] charL :: Char -> Literal@@ -472,11 +641,20 @@ #undef where +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE Char, String, Int, Frac, PrimInt, PrimWord, PrimFloat, PrimDouble,+ PrimChar, PrimString #-}+#endif+ -- ** `H.Sign` type Sign = H.Sign () pattern Signless = H.Signless () :: Sign pattern Negative = H.Negative () :: Sign +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE Signless, Negative #-}+#endif+ -- ** `H.Exp` type Exp = H.Exp () pattern Var a = H.Var () (a :: QName) :: Exp@@ -533,35 +711,70 @@ pattern RightArrApp a b = H.RightArrApp () (a :: Exp) (b :: Exp) :: Exp pattern LeftArrHighApp a b = H.LeftArrHighApp () (a :: Exp) (b :: Exp) :: Exp pattern RightArrHighApp a b = H.RightArrHighApp () (a :: Exp) (b :: Exp) :: Exp+pattern ArrOp a = H.ArrOp () (a :: Exp) :: Exp pattern LCase a = H.LCase () (a :: [Alt]) :: Exp +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE Var, OverloadedLabel, IPVar, Con, Lit, InfixApp, App, NegApp, Lambda, Let,+ If, MultiIf, Case, Do, MDo, Tuple, UnboxedSum, TupleSection, List,+ ParArray, Paren, LeftSection, RightSection, RecConstr, RecUpdate,+ EnumFrom, EnumFromTo, EnumFromThen, EnumFromThenTo, ParArrayFromTo,+ ParArrayFromThenTo, ListComp, ParComp, ParArrayComp, ExpTypeSig, VarQuote,+ TypQuote, BracketExp, SpliceExp, QuasiQuote, TypeApp, XTag, XETag,+ XPcdata, XExpTag, XChildTag, CorePragma, SCCPragma, GenPragma, Proc,+ LeftArrApp, RightArrApp, LeftArrHighApp, RightArrHighApp, ArrOp, LCase #-}+#endif+ -- ** `H.XName` type XName = H.XName () pattern XName a = H.XName () (a :: String) :: XName pattern XDomName a b = H.XDomName () (a :: String) (b :: String) :: XName +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE XName, XDomName #-}+#endif+ -- ** `H.XAttr` type XAttr = H.XAttr () pattern XAttr a b = H.XAttr () (a :: XName) (b :: Exp) :: XAttr +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE XAttr #-}+#endif+ -- ** `H.Bracket` type Bracket = H.Bracket () pattern ExpBracket a = H.ExpBracket () (a :: Exp) :: Bracket+pattern TExpBracket a = H.TExpBracket () (a :: Exp) :: Bracket pattern PatBracket a = H.PatBracket () (a :: Pat) :: Bracket pattern TypeBracket a = H.TypeBracket () (a :: Type) :: Bracket pattern DeclBracket a = H.DeclBracket () (a :: [Decl]) :: Bracket +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE ExpBracket, TExpBracket, PatBracket, TypeBracket, DeclBracket #-}+#endif+ -- ** `H.Splice` type Splice = H.Splice () pattern IdSplice a = H.IdSplice () (a :: String) :: Splice+pattern TIdSplice a = H.TIdSplice () (a :: String) :: Splice pattern ParenSplice a = H.ParenSplice () (a :: Exp) :: Splice+pattern TParenSplice a = H.TParenSplice () (a :: Exp) :: Splice +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE IdSplice, TIdSplice, ParenSplice, TParenSplice #-}+#endif+ -- ** `H.Safety` type Safety = H.Safety () pattern PlayRisky = H.PlayRisky () :: Safety pattern PlaySafe a = H.PlaySafe () (a :: Bool) :: Safety pattern PlayInterruptible = H.PlayInterruptible () :: Safety +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE PlayRisky, PlaySafe, PlayInterruptible #-}+#endif+ -- ** `H.CallConv` type CallConv = H.CallConv () pattern StdCall = H.StdCall () :: CallConv@@ -573,12 +786,20 @@ pattern JavaScript = H.JavaScript () :: CallConv pattern CApi = H.CApi () :: CallConv +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE StdCall, CCall, CPlusPlus, DotNet, Jvm, Js, JavaScript, CApi #-}+#endif+ -- ** `H.ModulePragma` type ModulePragma = H.ModulePragma () pattern LanguagePragma a = H.LanguagePragma () (a :: [Name]) :: ModulePragma pattern OptionsPragma a b = H.OptionsPragma () (a :: (Maybe Tool)) (b :: String) :: ModulePragma pattern AnnModulePragma a = H.AnnModulePragma () (a :: Annotation) :: ModulePragma +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE LanguagePragma, OptionsPragma, AnnModulePragma #-}+#endif+ -- skipped: data Tool -- ** `H.Overlap`@@ -590,25 +811,45 @@ pattern Overlappable = H.Overlappable () :: Overlap pattern Incoherent = H.Incoherent () :: Overlap +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE NoOverlap, Overlap, Overlapping, Overlaps, Overlappable, Incoherent #-}+#endif+ -- ** `H.Activation` type Activation = H.Activation () pattern ActiveFrom a = H.ActiveFrom () (a :: Int) :: Activation pattern ActiveUntil a = H.ActiveUntil () (a :: Int) :: Activation +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE ActiveFrom, ActiveUntil #-}+#endif+ -- ** `H.Rule` type Rule = H.Rule () pattern Rule a b c d e = H.Rule () (a :: String) (b :: (Maybe Activation)) (c :: (Maybe [RuleVar])) (d :: Exp) (e :: Exp) :: Rule +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE Rule #-}+#endif+ -- ** `H.RuleVar` type RuleVar = H.RuleVar () pattern RuleVar a = H.RuleVar () (a :: Name) :: RuleVar pattern TypedRuleVar a b = H.TypedRuleVar () (a :: Name) (b :: Type) :: RuleVar +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE RuleVar, TypedRuleVar #-}+#endif+ -- ** `H.WarningText` type WarningText = H.WarningText () pattern DeprText a = H.DeprText () (a :: String) :: WarningText pattern WarnText a = H.WarnText () (a :: String) :: WarningText +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE DeprText, WarnText #-}+#endif+ -- ** `H.Pat` type Pat = H.Pat () pattern PVar a = H.PVar () (a :: Name) :: Pat@@ -636,10 +877,20 @@ pattern PQuasiQuote a b = H.PQuasiQuote () (a :: String) (b :: String) :: Pat pattern PBangPat a = H.PBangPat () (a :: Pat) :: Pat +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE PVar, PLit, PNPlusK, PInfixApp, PApp, PTuple, PUnboxedSum, PList, PParen,+ PRec, PAsPat, PWildCard, PIrrPat, PatTypeSig, PViewPat, PRPat, PXTag,+ PXETag, PXPcdata, PXPatTag, PXRPats, PSplice, PQuasiQuote, PBangPat #-}+#endif+ -- ** `H.PXAttr` type PXAttr = H.PXAttr () pattern PXAttr a b = H.PXAttr () (a :: XName) (b :: Pat) :: PXAttr +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE PXAttr #-}+#endif+ -- ** `H.RPatOp` type RPatOp = H.RPatOp () pattern RPStar = H.RPStar () :: RPatOp@@ -649,6 +900,10 @@ pattern RPOpt = H.RPOpt () :: RPatOp pattern RPOptG = H.RPOptG () :: RPatOp +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE RPStar, RPStarG, RPPlus, RPPlusG, RPOpt, RPOptG #-}+#endif+ -- ** `H.RPat` type RPat = H.RPat () pattern RPOp a b = H.RPOp () (a :: RPat) (b :: RPatOp) :: RPat@@ -660,12 +915,20 @@ pattern RPParen a = H.RPParen () (a :: RPat) :: RPat pattern RPPat a = H.RPPat () (a :: Pat) :: RPat +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE RPOp, RPEither, RPSeq, RPGuard, RPCAs, RPAs, RPParen, RPPat #-}+#endif+ -- ** `H.PatField` type PatField = H.PatField () pattern PFieldPat a b = H.PFieldPat () (a :: QName) (b :: Pat) :: PatField pattern PFieldPun a = H.PFieldPun () (a :: QName) :: PatField pattern PFieldWildcard = H.PFieldWildcard () :: PatField +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE PFieldPat, PFieldPun, PFieldWildcard #-}+#endif+ -- ** `H.Stmt` type Stmt = H.Stmt () pattern Generator a b = H.Generator () (a :: Pat) (b :: Exp) :: Stmt@@ -673,6 +936,10 @@ pattern LetStmt a = H.LetStmt () (a :: Binds) :: Stmt pattern RecStmt a = H.RecStmt () (a :: [Stmt]) :: Stmt +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE Generator, Qualifier, LetStmt, RecStmt #-}+#endif+ -- ** `H.QualStmt` type QualStmt = H.QualStmt () pattern QualStmt a = H.QualStmt () (a :: Stmt) :: QualStmt@@ -682,15 +949,27 @@ pattern GroupUsing a = H.GroupUsing () (a :: Exp) :: QualStmt pattern GroupByUsing a b = H.GroupByUsing () (a :: Exp) (b :: Exp) :: QualStmt +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE QualStmt, ThenTrans, ThenBy, GroupBy, GroupUsing, GroupByUsing #-}+#endif+ -- ** `H.FieldUpdate` type FieldUpdate = H.FieldUpdate () pattern FieldUpdate a b = H.FieldUpdate () (a :: QName) (b :: Exp) :: FieldUpdate pattern FieldPun a = H.FieldPun () (a :: QName) :: FieldUpdate pattern FieldWildcard = H.FieldWildcard () :: FieldUpdate +#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE FieldUpdate, FieldPun, FieldWildcard #-}+#endif+ -- ** `H.Alt` type Alt = H.Alt () pattern Alt a b c = H.Alt () (a :: Pat) (b :: Rhs) (c :: (Maybe Binds)) :: Alt++#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)+{-# COMPLETE Alt #-}+#endif -- * Functions