[Git][ghc/ghc][ghc-9.0] 5 commits: Deprecate Data.Semigroup.Option
Ben Gamari
gitlab at gitlab.haskell.org
Sat Sep 26 05:17:13 UTC 2020
Ben Gamari pushed to branch ghc-9.0 at Glasgow Haskell Compiler / GHC
Commits:
b1c4116d by Simon Jakobi at 2020-09-24T13:09:09-04:00
Deprecate Data.Semigroup.Option
Libraries email: https://mail.haskell.org/pipermail/libraries/2018-April/028724.html
GHC issue: https://gitlab.haskell.org/ghc/ghc/issues/15028
Corresponding PRs for deepseq:
* https://github.com/haskell/deepseq/pull/55
* https://github.com/haskell/deepseq/pull/57
Bumps the deepseq submodule.
(cherry picked from commit a90d13091ff82e954432bedd0bb20845c666eddb)
- - - - -
29fc00bc by Wander Hillen at 2020-09-24T13:11:02-04:00
Export singleton function from Data.List
Data.OldList exports a monomorphized singleton function but
it is not re-exported by Data.List. Adding the export to
Data.List causes a conflict with a 14-year old function of the
same name and type by SPJ in GHC.Utils.Misc. We can't just remove
this function because that leads to a problems when building
GHC with a stage0 compiler that does not have singleton in
Data.List yet. We also can't hide the function in GHC.Utils.Misc
since it is not possible to hide a function from a module if the
module does not export the function. To work around this, all
places where the Utils.Misc singleton was used now use a qualified
version like Utils.singleton and in GHC.Utils.Misc we are very
specific about which version we export.
(cherry picked from commit e195dae6d959e2a9b1a22a2ca78db5955e1d7dea)
- - - - -
7f418acf by Ryan Scott at 2020-09-24T13:14:46-04:00
Remove ConDeclGADTPrefixPs
This removes the `ConDeclGADTPrefixPs` per the discussion in #18517.
Most of this patch simply removes code, although the code in the
`rnConDecl` case for `ConDeclGADTPrefixPs` had to be moved around a
bit:
* The nested `forall`s check now lives in the `rnConDecl` case for
`ConDeclGADT`.
* The `LinearTypes`-specific code that used to live in the
`rnConDecl` case for `ConDeclGADTPrefixPs` now lives in
`GHC.Parser.PostProcess.mkGadtDecl`, which is now monadic so that
it can check if `-XLinearTypes` is enabled.
Fixes #18157.
(cherry picked from commit 3ea8ac774efd9ee25156f444eacf49893d48a6c9)
- - - - -
4c37274a by Ben Gamari at 2020-09-25T17:39:53-04:00
Bump Cabal, haskeline, directory, process submodules
To accomodate Win32 2.10.0.0.
- - - - -
12957a0b by Ben Gamari at 2020-09-25T17:39:53-04:00
Disable -Wdeprecations for deepseq
Use to use of Data.Semigroup.Option for NFData instance.
- - - - -
30 changed files:
- compiler/GHC/Builtin/Utils.hs
- compiler/GHC/Core/Rules.hs
- compiler/GHC/Hs/Decls.hs
- compiler/GHC/Hs/Instances.hs
- compiler/GHC/Hs/Type.hs
- compiler/GHC/Hs/Utils.hs
- compiler/GHC/Iface/Recomp.hs
- compiler/GHC/Parser.y
- compiler/GHC/Parser/PostProcess.hs
- compiler/GHC/Parser/PostProcess/Haddock.hs
- compiler/GHC/Rename/Module.hs
- compiler/GHC/Rename/Names.hs
- compiler/GHC/Tc/Gen/Sig.hs
- compiler/GHC/ThToHs.hs
- compiler/GHC/Types/Name/Reader.hs
- compiler/GHC/Utils/Misc.hs
- compiler/ghc.cabal.in
- ghc/ghc-bin.cabal.in
- hadrian/src/Settings/Warnings.hs
- libraries/Cabal
- libraries/base/Data/List.hs
- libraries/base/Data/Semigroup.hs
- libraries/base/changelog.md
- libraries/directory
- libraries/haskeline
- libraries/process
- mk/warnings.mk
- testsuite/tests/haddock/should_compile_flag_haddock/T17544.stderr
- testsuite/tests/haddock/should_compile_flag_haddock/T17544_kw.stderr
- testsuite/tests/parser/should_compile/T15323.stderr
Changes:
=====================================
compiler/GHC/Builtin/Utils.hs
=====================================
@@ -71,7 +71,7 @@ import GHC.Driver.Types
import GHC.Core.Class
import GHC.Core.TyCon
import GHC.Types.Unique.FM
-import GHC.Utils.Misc
+import GHC.Utils.Misc as Utils
import GHC.Builtin.Types.Literals ( typeNatTyCons )
import GHC.Hs.Doc
@@ -179,7 +179,7 @@ knownKeyNamesOkay all_names
| otherwise
= Just badNamesStr
where
- namesEnv = foldl' (\m n -> extendNameEnv_Acc (:) singleton m n n)
+ namesEnv = foldl' (\m n -> extendNameEnv_Acc (:) Utils.singleton m n n)
emptyUFM all_names
badNamesEnv = filterNameEnv (\ns -> ns `lengthExceeds` 1) namesEnv
badNamesPairs = nonDetUFMToList badNamesEnv
=====================================
compiler/GHC/Core/Rules.hs
=====================================
@@ -65,7 +65,7 @@ import GHC.Utils.Outputable
import GHC.Data.FastString
import GHC.Data.Maybe
import GHC.Data.Bag
-import GHC.Utils.Misc
+import GHC.Utils.Misc as Utils
import Data.List
import Data.Ord
import Control.Monad ( guard )
@@ -356,7 +356,7 @@ unionRuleBase rb1 rb2 = plusNameEnv_C (++) rb1 rb2
extendRuleBase :: RuleBase -> CoreRule -> RuleBase
extendRuleBase rule_base rule
- = extendNameEnv_Acc (:) singleton rule_base (ruleIdName rule) rule
+ = extendNameEnv_Acc (:) Utils.singleton rule_base (ruleIdName rule) rule
pprRuleBase :: RuleBase -> SDoc
pprRuleBase rules = pprUFM rules $ \rss ->
=====================================
compiler/GHC/Hs/Decls.hs
=====================================
@@ -71,7 +71,7 @@ module GHC.Hs.Decls (
ForeignDecl(..), LForeignDecl, ForeignImport(..), ForeignExport(..),
CImportSpec(..),
-- ** Data-constructor declarations
- ConDecl(..), LConDecl, ConDeclGADTPrefixPs(..),
+ ConDecl(..), LConDecl,
HsConDeclDetails, hsConDeclArgTys, hsConDeclTheta,
getConNames, getConArgs,
-- ** Document comments
@@ -111,7 +111,6 @@ import GHC.Core.Coercion
import GHC.Types.ForeignCall
import GHC.Hs.Extension
import GHC.Types.Name
-import GHC.Types.Name.Reader
import GHC.Types.Name.Set
-- others:
@@ -1435,12 +1434,13 @@ data ConDecl pass
{ con_g_ext :: XConDeclGADT pass
, con_names :: [Located (IdP pass)]
- -- The next four fields describe the type after the '::'
+ -- The following fields describe the type after the '::'
-- See Note [GADT abstract syntax]
- -- The following field is Located to anchor API Annotations,
- -- AnnForall and AnnDot.
- , con_forall :: Located Bool -- ^ True <=> explicit forall
+ , con_forall :: Located Bool -- ^ True <=> explicit forall
-- False => hsq_explicit is empty
+ --
+ -- The 'XRec' is used to anchor API
+ -- annotations, AnnForall and AnnDot.
, con_qvars :: [LHsTyVarBndr Specificity pass]
-- Whether or not there is an /explicit/ forall, we still
-- need to capture the implicitly-bound type/kind variables
@@ -1477,25 +1477,18 @@ type instance XConDeclGADT GhcTc = NoExtField
type instance XConDeclH98 (GhcPass _) = NoExtField
-type instance XXConDecl GhcPs = ConDeclGADTPrefixPs
-type instance XXConDecl GhcRn = NoExtCon
-type instance XXConDecl GhcTc = NoExtCon
-
--- | Stores the types of prefix GADT constructors in the parser. This is used
--- in lieu of ConDeclGADT, which requires knowing the specific argument and
--- result types, as this is difficult to determine in general in the parser.
--- See @Note [GADT abstract syntax]@.
-data ConDeclGADTPrefixPs = ConDeclGADTPrefixPs
- { con_gp_names :: [Located RdrName]
- -- ^ The GADT constructor declaration's names.
- , con_gp_ty :: LHsSigType GhcPs
- -- ^ The type after the @::@.
- , con_gp_doc :: Maybe LHsDocString
- -- ^ A possible Haddock comment.
- }
+type instance XXConDecl (GhcPass _) = NoExtCon
{- Note [GADT abstract syntax]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+The types of both forms of GADT constructors are very structured, as they
+must consist of the quantified type variables (if provided), followed by the
+context (if provided), followed by the argument types (if provided), followed
+by the result type. (See "Wrinkle: No nested foralls or contexts" below for
+more discussion on the restrictions imposed here.) As a result, instead of
+storing the type of a GADT constructor as a single LHsType, we split it up
+into its constituent components for easier access.
+
There are two broad ways to classify GADT constructors:
* Record-syntax constructors. For example:
@@ -1508,48 +1501,45 @@ There are two broad ways to classify GADT constructors:
data T a where
K :: forall a. Ord a => [a] -> ... -> T a
-Initially, both forms of GADT constructors are initially parsed as a single
-LHsType. However, GADTs have a certain structure, requiring distinct argument
-and result types, as well as imposing restrictions on where `forall`s and
-contexts can be (see "Wrinkle: No nested foralls or contexts" below). As a
-result, it is convenient to split up the LHsType into its individual
-components, which are stored in the ConDeclGADT constructor of ConDecl.
-
-Where should this splitting occur? For GADT constructors with record syntax,
-we split in the parser (in GHC.Parser.PostProcess.mkGadtDecl). We must do this
-splitting before the renamer, as we need the record field names for use in
-GHC.Hs.Utils.hsConDeclsBinders.
+This distinction is recorded in the `con_args :: HsConDetails pass`, which
+tracks if we're dealing with a RecCon or PrefixCon. It is easy to distinguish
+the two in the AST since record GADT constructors use HsRecTy. This distinction
+is made in GHC.Parser.PostProcess.mkGadtDecl.
-For prefix GADT constructors, however, the situation is more complicated. It
-can be difficult to split a prefix GADT type until we know type operator
-fixities. Consider this, for example:
+It is worth elaborating a bit more on the process of splitting the argument
+types of a GADT constructor, since there are some non-obvious details involved.
+While splitting the argument types of a record GADT constructor is easy (they
+are stored in an HsRecTy), splitting the arguments of a prefix GADT constructor
+is trickier. The basic idea is that we must split along the outermost function
+arrows ((->) and (#->)) in the type, which GHC.Hs.Type.splitHsFunType
+accomplishes. But what about type operators? Consider:
C :: a :*: b -> a :*: b -> a :+: b
-Initially, the type of C will parse as:
+This could parse in many different ways depending on the precedences of each
+type operator. In particular, if (:*:) were to have lower precedence than (->),
+then it could very well parse like this:
- a :*: (b -> (a :*: (b -> (a :+: b))))
+ a :*: ((b -> a) :*: ((b -> a) :+: b)))
-So it's hard to split up the arguments until we've done the precedence
-resolution (in the renamer). (Unlike prefix GADT types, record GADT types
-do not have this problem because of their uniform syntax.)
+This would give the false impression that the whole type is part of one large
+return type, with no arguments. Note that we do not fully resolve the exact
+precedences of each user-defined type operator until the renamer, so this a
+more difficult task for the parser.
-As a result, we deliberately avoid splitting prefix GADT types in the parser.
-Instead, we store the entire LHsType in ConDeclGADTPrefixPs, a GHC-specific
-extension constructor to ConDecl. Later, in the renamer
-(in GHC.Rename.Module.rnConDecl), we resolve the fixities of all type operators
-in the LHsType, which facilitates splitting it into argument and result types
-accurately. We finish renaming a ConDeclGADTPrefixPs by putting the split
-components into a ConDeclGADT. This is why ConDeclGADTPrefixPs has the suffix
--Ps, as it is only used by the parser.
+Fortunately, there is no risk of the above happening. GHC's parser gives
+special treatment to function arrows, and as a result, they are always parsed
+with a lower precedence than any other type operator. As a result, the type
+above is actually parsed like this:
-Note that the existence of ConDeclGADTPrefixPs does not imply that ConDeclGADT
-goes completely unused by the parser. Other consumers of GHC's abstract syntax
-are still free to use ConDeclGADT. Indeed, both Haddock and Template Haskell
-construct values of type `ConDecl GhcPs` by way of ConDeclGADT, as neither of
-them have the same difficulties with operator precedence that GHC's parser
-does. As an example, see GHC.ThToHs.cvtConstr, which converts Template Haskell
-syntax into GHC syntax.
+ (a :*: b) -> ((a :*: b) -> (a :+: b))
+
+While we won't know the exact precedences of (:*:) and (:+:) until the renamer,
+all we are concerned about in the parser is identifying the overall shape of
+the argument and result types, which we can accomplish by piggybacking on the
+special treatment given to function arrows. In a future where function arrows
+aren't given special status in the parser, we will likely have to modify
+GHC.Parser.PostProcess.mergeOps to preserve this trick.
-----
-- Wrinkle: No nested foralls or contexts
@@ -1679,14 +1669,6 @@ pp_condecls cs
[] -> False
(L _ ConDeclH98{} : _) -> False
(L _ ConDeclGADT{} : _) -> True
- (L _ (XConDecl x) : _) ->
- case ghcPass @p of
- GhcPs | ConDeclGADTPrefixPs{} <- x
- -> True
-#if __GLASGOW_HASKELL__ < 811
- GhcRn -> noExtCon x
- GhcTc -> noExtCon x
-#endif
instance (OutputableBndrId p) => Outputable (ConDecl (GhcPass p)) where
ppr = pprConDecl
@@ -1728,16 +1710,6 @@ pprConDecl (ConDeclGADT { con_names = cons, con_qvars = qvars
ppr_arrow_chain (a:as) = sep (a : map (arrow <+>) as)
ppr_arrow_chain [] = empty
-pprConDecl (XConDecl x) =
- case ghcPass @p of
- GhcPs | ConDeclGADTPrefixPs { con_gp_names = cons, con_gp_ty = ty
- , con_gp_doc = doc } <- x
- -> ppr_mbDoc doc <+> ppr_con_names cons <+> dcolon <+> ppr ty
-#if __GLASGOW_HASKELL__ < 811
- GhcRn -> noExtCon x
- GhcTc -> noExtCon x
-#endif
-
ppr_con_names :: (OutputableBndr a) => [Located a] -> SDoc
ppr_con_names = pprWithCommas (pprPrefixOcc . unLoc)
=====================================
compiler/GHC/Hs/Instances.hs
=====================================
@@ -166,8 +166,6 @@ deriving instance Data (ConDecl GhcPs)
deriving instance Data (ConDecl GhcRn)
deriving instance Data (ConDecl GhcTc)
-deriving instance Data ConDeclGADTPrefixPs
-
-- deriving instance DataIdLR p p => Data (TyFamInstDecl p)
deriving instance Data (TyFamInstDecl GhcPs)
deriving instance Data (TyFamInstDecl GhcRn)
=====================================
compiler/GHC/Hs/Type.hs
=====================================
@@ -68,7 +68,7 @@ module GHC.Hs.Type (
splitLHsInstDeclTy, getLHsInstDeclHead, getLHsInstDeclClass_maybe,
splitLHsPatSynTy,
splitLHsForAllTyInvis, splitLHsForAllTyInvis_KP, splitLHsQualTy,
- splitLHsSigmaTyInvis, splitLHsGADTPrefixTy,
+ splitLHsSigmaTyInvis, splitLHsGadtTy,
splitHsFunType, hsTyGetAppHead_maybe,
mkHsOpTy, mkHsAppTy, mkHsAppTys, mkHsAppKindTy,
ignoreParens, hsSigType, hsSigWcType, hsPatSigType,
@@ -1331,7 +1331,9 @@ mkHsAppKindTy ext ty k
-- splitHsFunType decomposes a type (t1 -> t2 ... -> tn)
-- Breaks up any parens in the result type:
-- splitHsFunType (a -> (b -> c)) = ([a,b], c)
-splitHsFunType :: LHsType GhcRn -> ([HsScaled GhcRn (LHsType GhcRn)], LHsType GhcRn)
+splitHsFunType ::
+ LHsType (GhcPass p)
+ -> ([HsScaled (GhcPass p) (LHsType (GhcPass p))], LHsType (GhcPass p))
splitHsFunType (L _ (HsParTy _ ty))
= splitHsFunType ty
@@ -1460,7 +1462,7 @@ splitLHsSigmaTyInvis_KP ty
, (mb_ctxt, ty2) <- splitLHsQualTy_KP ty1
= (mb_tvbs, mb_ctxt, ty2)
--- | Decompose a prefix GADT type into its constituent parts.
+-- | Decompose a GADT type into its constituent parts.
-- Returns @(mb_tvbs, mb_ctxt, body)@, where:
--
-- * @mb_tvbs@ are @Just@ the leading @forall at s, if they are provided.
@@ -1474,10 +1476,10 @@ splitLHsSigmaTyInvis_KP ty
-- This function is careful not to look through parentheses.
-- See @Note [GADT abstract syntax] (Wrinkle: No nested foralls or contexts)@
-- "GHC.Hs.Decls" for why this is important.
-splitLHsGADTPrefixTy ::
+splitLHsGadtTy ::
LHsType pass
-> (Maybe [LHsTyVarBndr Specificity pass], Maybe (LHsContext pass), LHsType pass)
-splitLHsGADTPrefixTy = splitLHsSigmaTyInvis_KP
+splitLHsGadtTy = splitLHsSigmaTyInvis_KP
-- | Decompose a type of the form @forall <tvs>. body@ into its constituent
-- parts. Only splits type variable binders that
=====================================
compiler/GHC/Hs/Utils.hs
=====================================
@@ -1267,16 +1267,6 @@ hsConDeclsBinders cons
(remSeen', flds) = get_flds remSeen args
(ns, fs) = go remSeen' rs
- XConDecl x -> case ghcPass @p of
- GhcPs | ConDeclGADTPrefixPs { con_gp_names = names } <- x
- -> (map (L loc . unLoc) names ++ ns, fs)
-#if __GLASGOW_HASKELL__ < 811
- GhcRn -> noExtCon x
- GhcTc -> noExtCon x
-#endif
- where
- (ns, fs) = go remSeen rs
-
get_flds :: Seen p -> HsConDeclDetails (GhcPass p)
-> (Seen p, [LFieldOcc (GhcPass p)])
get_flds remSeen (RecCon flds)
=====================================
compiler/GHC/Iface/Recomp.hs
=====================================
@@ -34,7 +34,7 @@ import GHC.Data.Graph.Directed
import GHC.Types.SrcLoc
import GHC.Utils.Outputable as Outputable
import GHC.Types.Unique
-import GHC.Utils.Misc hiding ( eqListBy )
+import GHC.Utils.Misc as Utils hiding ( eqListBy )
import GHC.Data.Maybe
import GHC.Utils.Binary
import GHC.Utils.Fingerprint
@@ -1332,7 +1332,7 @@ mkOrphMap get_key decls
where
go (non_orphs, orphs) d
| NotOrphan occ <- get_key d
- = (extendOccEnv_Acc (:) singleton non_orphs occ d, orphs)
+ = (extendOccEnv_Acc (:) Utils.singleton non_orphs occ d, orphs)
| otherwise = (non_orphs, d:orphs)
-- -----------------------------------------------------------------------------
=====================================
compiler/GHC/Parser.y
=====================================
@@ -2173,8 +2173,9 @@ gadt_constr :: { LConDecl GhcPs }
-- see Note [Difference in parsing GADT and data constructors]
-- Returns a list because of: C,D :: ty
: optSemi con_list '::' sigtype
- {% ams (sLL $2 $> (mkGadtDecl (unLoc $2) $4))
- [mu AnnDcolon $3] }
+ {% do { decl <- mkGadtDecl (unLoc $2) $4
+ ; ams (sLL $2 $> decl)
+ [mu AnnDcolon $3] } }
{- Note [Difference in parsing GADT and data constructors]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
=====================================
compiler/GHC/Parser/PostProcess.hs
=====================================
@@ -688,34 +688,41 @@ mkConDeclH98 name mb_forall mb_cxt args
, con_doc = Nothing }
-- | Construct a GADT-style data constructor from the constructor names and
--- their type. This will return different AST forms for record syntax
--- constructors and prefix constructors, as the latter must be handled
--- specially in the renamer. See @Note [GADT abstract syntax]@ in
--- "GHC.Hs.Decls" for the full story.
+-- their type. Some interesting aspects of this function:
+--
+-- * This splits up the constructor type into its quantified type variables (if
+-- provided), context (if provided), argument types, and result type, and
+-- records whether this is a prefix or record GADT constructor. See
+-- Note [GADT abstract syntax] in "GHC.Hs.Decls" for more details.
+--
+-- * If -XLinearTypes is not enabled, the function arrows in a prefix GADT
+-- constructor are always interpreted as linear. If -XLinearTypes is enabled,
+-- we faithfully record whether -> or #-> was used.
mkGadtDecl :: [Located RdrName]
-> LHsType GhcPs
- -> ConDecl GhcPs
-mkGadtDecl names ty
- | Just (mtvs, mcxt, args, res_ty) <- mb_record_gadt ty
- = ConDeclGADT { con_g_ext = noExtField
- , con_names = names
- , con_forall = L (getLoc ty) $ isJust mtvs
- , con_qvars = fromMaybe [] mtvs
- , con_mb_cxt = mcxt
- , con_args = args
- , con_res_ty = res_ty
- , con_doc = Nothing }
- | otherwise
- = XConDecl $ ConDeclGADTPrefixPs { con_gp_names = names
- , con_gp_ty = mkLHsSigType ty
- , con_gp_doc = Nothing }
+ -> P (ConDecl GhcPs)
+mkGadtDecl names ty = do
+ linearEnabled <- getBit LinearTypesBit
+
+ let (args, res_ty)
+ | L _ (HsFunTy _ _w (L loc (HsRecTy _ rf)) res_ty) <- body_ty
+ = (RecCon (L loc rf), res_ty)
+ | otherwise
+ = let (arg_types, res_type) = splitHsFunType body_ty
+ arg_types' | linearEnabled = arg_types
+ | otherwise = map (hsLinear . hsScaledThing) arg_types
+ in (PrefixCon arg_types', res_type)
+
+ pure $ ConDeclGADT { con_g_ext = noExtField
+ , con_names = names
+ , con_forall = L (getLoc ty) $ isJust mtvs
+ , con_qvars = fromMaybe [] mtvs
+ , con_mb_cxt = mcxt
+ , con_args = args
+ , con_res_ty = res_ty
+ , con_doc = Nothing }
where
- mb_record_gadt ty
- | (mtvs, mcxt, body_ty) <- splitLHsGADTPrefixTy ty
- , L _ (HsFunTy _ _w (L loc (HsRecTy _ rf)) res_ty) <- body_ty
- = Just (mtvs, mcxt, RecCon (L loc rf), res_ty)
- | otherwise
- = Nothing
+ (mtvs, mcxt, body_ty) = splitLHsGadtTy ty
setRdrNameSpace :: RdrName -> NameSpace -> RdrName
-- ^ This rather gruesome function is used mainly by the parser.
=====================================
compiler/GHC/Parser/PostProcess/Haddock.hs
=====================================
@@ -714,15 +714,6 @@ instance HasHaddock (LConDecl GhcPs) where
ConDeclH98 { con_ext, con_name, con_forall, con_ex_tvs, con_mb_cxt,
con_doc = con_doc',
con_args = RecCon (L l_rec flds') }
- XConDecl (ConDeclGADTPrefixPs { con_gp_names, con_gp_ty }) -> do
- -- discardHasInnerDocs is ok because we don't need this info for GADTs.
- con_gp_doc' <- discardHasInnerDocs $ getConDoc (getLoc (head con_gp_names))
- con_gp_ty' <- addHaddock con_gp_ty
- pure $ L l_con_decl $
- XConDecl (ConDeclGADTPrefixPs
- { con_gp_names,
- con_gp_ty = con_gp_ty',
- con_gp_doc = con_gp_doc' })
-- Keep track of documentation comments on the data constructor or any of its
-- fields.
=====================================
compiler/GHC/Rename/Module.hs
=====================================
@@ -1856,7 +1856,6 @@ rnDataDefn doc (HsDataDefn { dd_ND = new_or_data, dd_cType = cType
where
h98_style = case condecls of -- Note [Stupid theta]
(L _ (ConDeclGADT {})) : _ -> False
- (L _ (XConDecl (ConDeclGADTPrefixPs {}))) : _ -> False
_ -> True
rn_derivs (L loc ds)
@@ -2245,6 +2244,12 @@ rnConDecl decl@(ConDeclGADT { con_names = names
; (new_args, fvs2) <- rnConDeclDetails (unLoc (head new_names)) ctxt args
; (new_res_ty, fvs3) <- rnLHsType ctxt res_ty
+ -- Ensure that there are no nested `forall`s or contexts, per
+ -- Note [GADT abstract syntax] (Wrinkle: No nested foralls or contexts)
+ -- in GHC.Hs.Type.
+ ; addNoNestedForallsContextsErr ctxt
+ (text "GADT constructor type signature") new_res_ty
+
; let all_fvs = fvs1 `plusFV` fvs2 `plusFV` fvs3
; traceRn "rnConDecl (ConDeclGADT)"
@@ -2255,47 +2260,6 @@ rnConDecl decl@(ConDeclGADT { con_names = names
, con_doc = mb_doc' },
all_fvs) } }
--- This case is only used for prefix GADT constructors generated by GHC's
--- parser, where we do not know the argument types until type operator
--- precedence has been resolved. See Note [GADT abstract syntax] in
--- GHC.Hs.Decls for the full story.
-rnConDecl (XConDecl (ConDeclGADTPrefixPs { con_gp_names = names, con_gp_ty = ty
- , con_gp_doc = mb_doc }))
- = do { mapM_ (addLocM checkConName) names
- ; new_names <- mapM lookupLocatedTopBndrRn names
- ; mb_doc' <- rnMbLHsDoc mb_doc
-
- ; let ctxt = ConDeclCtx new_names
- ; (ty', fvs) <- rnHsSigType ctxt TypeLevel ty
- ; linearTypes <- xopt LangExt.LinearTypes <$> getDynFlags
-
- -- Now that operator precedence has been resolved, we can split the
- -- GADT type into its individual components below.
- ; let HsIB { hsib_ext = implicit_tkvs, hsib_body = body } = ty'
- (mb_explicit_tkvs, mb_cxt, tau) = splitLHsGADTPrefixTy body
- lhas_forall = L (getLoc body) $ isJust mb_explicit_tkvs
- explicit_tkvs = fromMaybe [] mb_explicit_tkvs
- (arg_tys, res_ty) = splitHsFunType tau
- arg_details | linearTypes = PrefixCon arg_tys
- | otherwise = PrefixCon $ map (hsLinear . hsScaledThing) arg_tys
-
- -- NB: The only possibility here is PrefixCon. RecCon is handled
- -- separately, through ConDeclGADT, from the parser onwards.
-
- -- Ensure that there are no nested `forall`s or contexts, per
- -- Note [GADT abstract syntax] (Wrinkle: No nested foralls or contexts)
- -- in GHC.Hs.Type.
- ; addNoNestedForallsContextsErr ctxt
- (text "GADT constructor type signature") res_ty
-
- ; traceRn "rnConDecl (ConDeclGADTPrefixPs)"
- (ppr names $$ ppr implicit_tkvs $$ ppr explicit_tkvs)
- ; pure (ConDeclGADT { con_g_ext = implicit_tkvs, con_names = new_names
- , con_forall = lhas_forall, con_qvars = explicit_tkvs
- , con_mb_cxt = mb_cxt, con_args = arg_details
- , con_res_ty = res_ty, con_doc = mb_doc' },
- fvs) }
-
rnMbContext :: HsDocContext -> Maybe (LHsContext GhcPs)
-> RnM (Maybe (LHsContext GhcRn), FreeVars)
rnMbContext _ Nothing = return (Nothing, emptyFVs)
=====================================
compiler/GHC/Rename/Names.hs
=====================================
@@ -57,7 +57,7 @@ import GHC.Utils.Outputable as Outputable
import GHC.Data.Maybe
import GHC.Types.SrcLoc as SrcLoc
import GHC.Types.Basic ( TopLevelFlag(..), StringLiteral(..) )
-import GHC.Utils.Misc
+import GHC.Utils.Misc as Utils
import GHC.Data.FastString
import GHC.Data.FastString.Env
import GHC.Types.Id
@@ -1180,8 +1180,8 @@ mkChildEnv :: [GlobalRdrElt] -> NameEnv [GlobalRdrElt]
mkChildEnv gres = foldr add emptyNameEnv gres
where
add gre env = case gre_par gre of
- FldParent p _ -> extendNameEnv_Acc (:) singleton env p gre
- ParentIs p -> extendNameEnv_Acc (:) singleton env p gre
+ FldParent p _ -> extendNameEnv_Acc (:) Utils.singleton env p gre
+ ParentIs p -> extendNameEnv_Acc (:) Utils.singleton env p gre
NoParent -> env
findChildren :: NameEnv [a] -> Name -> [a]
=====================================
compiler/GHC/Tc/Gen/Sig.hs
=====================================
@@ -52,7 +52,7 @@ import GHC.Types.Name
import GHC.Types.Name.Env
import GHC.Utils.Outputable
import GHC.Types.SrcLoc
-import GHC.Utils.Misc( singleton )
+import GHC.Utils.Misc as Utils ( singleton )
import GHC.Data.Maybe( orElse )
import Data.Maybe( mapMaybe )
import Control.Monad( unless )
@@ -551,7 +551,7 @@ lookupPragEnv :: TcPragEnv -> Name -> [LSig GhcRn]
lookupPragEnv prag_fn n = lookupNameEnv prag_fn n `orElse` []
extendPragEnv :: TcPragEnv -> (Name, LSig GhcRn) -> TcPragEnv
-extendPragEnv prag_fn (n, sig) = extendNameEnv_Acc (:) singleton prag_fn n sig
+extendPragEnv prag_fn (n, sig) = extendNameEnv_Acc (:) Utils.singleton prag_fn n sig
---------------
mkPragEnv :: [LSig GhcRn] -> LHsBinds GhcRn -> TcPragEnv
=====================================
compiler/GHC/ThToHs.hs
=====================================
@@ -611,14 +611,6 @@ cvtConstr (ForallC tvs ctxt con)
where
all_tvs = tvs' ++ ex_tvs
- -- The GadtC and RecGadtC cases of cvtConstr will always return a
- -- ConDeclGADT, not a ConDeclGADTPrefixPs, so this case is unreachable.
- -- See Note [GADT abstract syntax] in GHC.Hs.Decls for more on the
- -- distinction between ConDeclGADT and ConDeclGADTPrefixPs.
- add_forall _ _ con@(XConDecl (ConDeclGADTPrefixPs {})) =
- pprPanic "cvtConstr.add_forall: Unexpected ConDeclGADTPrefixPs"
- (Outputable.ppr con)
-
cvtConstr (GadtC [] _strtys _ty)
= failWith (text "GadtC must have at least one constructor name")
=====================================
compiler/GHC/Types/Name/Reader.hs
=====================================
@@ -84,7 +84,7 @@ import GHC.Utils.Outputable
import GHC.Types.Unique
import GHC.Types.Unique.FM
import GHC.Types.Unique.Set
-import GHC.Utils.Misc
+import GHC.Utils.Misc as Utils
import GHC.Types.Name.Env
import Data.Data
@@ -959,7 +959,7 @@ mkGlobalRdrEnv :: [GlobalRdrElt] -> GlobalRdrEnv
mkGlobalRdrEnv gres
= foldr add emptyGlobalRdrEnv gres
where
- add gre env = extendOccEnv_Acc insertGRE singleton env
+ add gre env = extendOccEnv_Acc insertGRE Utils.singleton env
(greOccName gre)
gre
@@ -993,7 +993,7 @@ transformGREs trans_gre occs rdr_env
extendGlobalRdrEnv :: GlobalRdrEnv -> GlobalRdrElt -> GlobalRdrEnv
extendGlobalRdrEnv env gre
- = extendOccEnv_Acc insertGRE singleton env
+ = extendOccEnv_Acc insertGRE Utils.singleton env
(greOccName gre) gre
shadowNames :: GlobalRdrEnv -> [Name] -> GlobalRdrEnv
=====================================
compiler/GHC/Utils/Misc.hs
=====================================
@@ -42,7 +42,7 @@ module GHC.Utils.Misc (
listLengthCmp, atLength,
equalLength, compareLength, leLength, ltLength,
- isSingleton, only, singleton,
+ isSingleton, only, GHC.Utils.Misc.singleton,
notNull, snocView,
isIn, isn'tIn,
=====================================
compiler/ghc.cabal.in
=====================================
@@ -77,7 +77,7 @@ Library
ghci == @ProjectVersionMunged@
if os(windows)
- Build-Depends: Win32 >= 2.3 && < 2.10
+ Build-Depends: Win32 >= 2.3 && < 2.11
else
if flag(terminfo)
Build-Depends: terminfo == 0.4.*
=====================================
ghc/ghc-bin.cabal.in
=====================================
@@ -45,7 +45,7 @@ Executable ghc
ghc == @ProjectVersionMunged@
if os(windows)
- Build-Depends: Win32 >= 2.3 && < 2.10
+ Build-Depends: Win32 >= 2.3 && < 2.11
else
Build-Depends: unix >= 2.7 && < 2.9
=====================================
hadrian/src/Settings/Warnings.hs
=====================================
@@ -31,6 +31,7 @@ ghcWarningsArgs = do
, package bytestring ? pure [ "-Wno-inline-rule-shadowing" ]
, package compiler ? pure [ "-Wcpp-undef" ]
, package directory ? pure [ "-Wno-unused-imports" ]
+ , package deepseq ? pure [ "-Wno-deprecations" ]
, package ghc ? pure [ "-Wcpp-undef"
, "-Wincomplete-uni-patterns"
, "-Wincomplete-record-updates"
=====================================
libraries/Cabal
=====================================
@@ -1 +1 @@
-Subproject commit 5139d6e72d391bffa3cf06f08884277799eb0b45
+Subproject commit 5aea8a4b8463e1ae95272e190a1022764164294f
=====================================
libraries/base/Data/List.hs
=====================================
@@ -25,6 +25,7 @@ module Data.List
, tail
, init
, uncons
+ , singleton
, null
, length
=====================================
libraries/base/Data/Semigroup.hs
=====================================
@@ -350,8 +350,6 @@ instance Bifoldable Arg where
instance Bitraversable Arg where
bitraverse f g (Arg a b) = Arg <$> f a <*> g b
--- | Use @'Option' ('First' a)@ to get the behavior of
--- 'Data.Monoid.First' from "Data.Monoid".
newtype First a = First { getFirst :: a }
deriving ( Bounded -- ^ @since 4.9.0.0
, Eq -- ^ @since 4.9.0.0
@@ -408,8 +406,6 @@ instance Monad First where
instance MonadFix First where
mfix f = fix (f . getFirst)
--- | Use @'Option' ('Last' a)@ to get the behavior of
--- 'Data.Monoid.Last' from "Data.Monoid"
newtype Last a = Last { getLast :: a }
deriving ( Bounded -- ^ @since 4.9.0.0
, Eq -- ^ @since 4.9.0.0
@@ -514,6 +510,8 @@ mtimesDefault n x
| n == 0 = mempty
| otherwise = unwrapMonoid (stimes n (WrapMonoid x))
+{-# DEPRECATED Option, option "will be removed in GHC 9.2; use 'Maybe' instead." #-}
+
-- | 'Option' is effectively 'Maybe' with a better instance of
-- 'Monoid', built off of an underlying 'Semigroup' instead of an
-- underlying 'Monoid'.
@@ -523,8 +521,7 @@ mtimesDefault n x
--
-- In GHC 8.4 and higher, the 'Monoid' instance for 'Maybe' has been
-- corrected to lift a 'Semigroup' instance instead of a 'Monoid'
--- instance. Consequently, this type is no longer useful. It will be
--- marked deprecated in GHC 8.8 and removed in GHC 8.10.
+-- instance. Consequently, this type is no longer useful.
newtype Option a = Option { getOption :: Maybe a }
deriving ( Eq -- ^ @since 4.9.0.0
, Ord -- ^ @since 4.9.0.0
=====================================
libraries/base/changelog.md
=====================================
@@ -14,6 +14,9 @@
* The planned deprecation of `Data.Monoid.First` and `Data.Monoid.Last`
is scrapped due to difficulties with the suggested migration path.
+ * `Data.Semigroup.Option` and the accompanying `option` function are
+ deprecated and scheduled for removal in 4.16.
+
* Add `Generic` instances to `Fingerprint`, `GiveGCStats`, `GCFlags`,
`ConcFlags`, `DebugFlags`, `CCFlags`, `DoHeapProfile`, `ProfFlags`,
`DoTrace`, `TraceFlags`, `TickyFlags`, `ParFlags`, `RTSFlags`, `RTSStats`,
=====================================
libraries/directory
=====================================
@@ -1 +1 @@
-Subproject commit c16afcda5708ee9944afa7ea6858e5be894fe67e
+Subproject commit b697b3ea77dd4803f2f8f676dd64c8ea5277fcf0
=====================================
libraries/haskeline
=====================================
@@ -1 +1 @@
-Subproject commit 5f16b76168f13c6413413386efc44fb1152048d5
+Subproject commit 2790f1c6ed94990ed51466079e8fb1097129c9b8
=====================================
libraries/process
=====================================
@@ -1 +1 @@
-Subproject commit cb1d1a6ead68f0e1b209277e79ec608980e9ac84
+Subproject commit 72c6be917064c923e365622032d1f2fa07acb5eb
=====================================
mk/warnings.mk
=====================================
@@ -80,6 +80,8 @@ libraries/haskeline_dist-install_EXTRA_HC_OPTS += -Wno-unused-imports
libraries/haskeline_dist-install_EXTRA_HC_OPTS += -Wno-redundant-constraints
libraries/haskeline_dist-install_EXTRA_HC_OPTS += -Wno-simplifiable-class-constraints
+# temporarily turn off deprecations in deepseq due to NFData Option instance.
+libraries/deepseq_dist-install_EXTRA_HC_OPTS += -Wno-deprecations
# temporarily turn off unused-imports warnings for pretty
libraries/pretty_dist-install_EXTRA_HC_OPTS += -Wno-unused-imports
=====================================
testsuite/tests/haddock/should_compile_flag_haddock/T17544.stderr
=====================================
@@ -372,31 +372,35 @@
(Nothing)
(Nothing)
[({ T17544.hs:25:5-18 }
- (XConDecl
- (ConDeclGADTPrefixPs
- [({ T17544.hs:25:5-8 }
- (Unqual
- {OccName: MkD5}))]
- (HsIB
+ (ConDeclGADT
+ (NoExtField)
+ [({ T17544.hs:25:5-8 }
+ (Unqual
+ {OccName: MkD5}))]
+ ({ T17544.hs:25:13-18 }
+ (False))
+ []
+ (Nothing)
+ (PrefixCon
+ [])
+ ({ T17544.hs:25:13-18 }
+ (HsAppTy
(NoExtField)
- ({ T17544.hs:25:13-18 }
- (HsAppTy
+ ({ T17544.hs:25:13-14 }
+ (HsTyVar
(NoExtField)
+ (NotPromoted)
({ T17544.hs:25:13-14 }
- (HsTyVar
- (NoExtField)
- (NotPromoted)
- ({ T17544.hs:25:13-14 }
- (Unqual
- {OccName: D5}))))
+ (Unqual
+ {OccName: D5}))))
+ ({ T17544.hs:25:16-18 }
+ (HsTyVar
+ (NoExtField)
+ (NotPromoted)
({ T17544.hs:25:16-18 }
- (HsTyVar
- (NoExtField)
- (NotPromoted)
- ({ T17544.hs:25:16-18 }
- (Unqual
- {OccName: Int})))))))
- (Nothing))))]
+ (Unqual
+ {OccName: Int}))))))
+ (Nothing)))]
({ <no location info> }
[]))))))]
(Nothing)))))
@@ -504,31 +508,35 @@
(Nothing)
(Nothing)
[({ T17544.hs:31:5-18 }
- (XConDecl
- (ConDeclGADTPrefixPs
- [({ T17544.hs:31:5-8 }
- (Unqual
- {OccName: MkD6}))]
- (HsIB
+ (ConDeclGADT
+ (NoExtField)
+ [({ T17544.hs:31:5-8 }
+ (Unqual
+ {OccName: MkD6}))]
+ ({ T17544.hs:31:13-18 }
+ (False))
+ []
+ (Nothing)
+ (PrefixCon
+ [])
+ ({ T17544.hs:31:13-18 }
+ (HsAppTy
(NoExtField)
- ({ T17544.hs:31:13-18 }
- (HsAppTy
+ ({ T17544.hs:31:13-14 }
+ (HsTyVar
(NoExtField)
+ (NotPromoted)
({ T17544.hs:31:13-14 }
- (HsTyVar
- (NoExtField)
- (NotPromoted)
- ({ T17544.hs:31:13-14 }
- (Unqual
- {OccName: D6}))))
+ (Unqual
+ {OccName: D6}))))
+ ({ T17544.hs:31:16-18 }
+ (HsTyVar
+ (NoExtField)
+ (NotPromoted)
({ T17544.hs:31:16-18 }
- (HsTyVar
- (NoExtField)
- (NotPromoted)
- ({ T17544.hs:31:16-18 }
- (Unqual
- {OccName: Int})))))))
- (Nothing))))]
+ (Unqual
+ {OccName: Int}))))))
+ (Nothing)))]
({ <no location info> }
[]))))))]
(Nothing)))))
@@ -636,31 +644,35 @@
(Nothing)
(Nothing)
[({ T17544.hs:37:5-18 }
- (XConDecl
- (ConDeclGADTPrefixPs
- [({ T17544.hs:37:5-8 }
- (Unqual
- {OccName: MkD7}))]
- (HsIB
+ (ConDeclGADT
+ (NoExtField)
+ [({ T17544.hs:37:5-8 }
+ (Unqual
+ {OccName: MkD7}))]
+ ({ T17544.hs:37:13-18 }
+ (False))
+ []
+ (Nothing)
+ (PrefixCon
+ [])
+ ({ T17544.hs:37:13-18 }
+ (HsAppTy
(NoExtField)
- ({ T17544.hs:37:13-18 }
- (HsAppTy
+ ({ T17544.hs:37:13-14 }
+ (HsTyVar
(NoExtField)
+ (NotPromoted)
({ T17544.hs:37:13-14 }
- (HsTyVar
- (NoExtField)
- (NotPromoted)
- ({ T17544.hs:37:13-14 }
- (Unqual
- {OccName: D7}))))
+ (Unqual
+ {OccName: D7}))))
+ ({ T17544.hs:37:16-18 }
+ (HsTyVar
+ (NoExtField)
+ (NotPromoted)
({ T17544.hs:37:16-18 }
- (HsTyVar
- (NoExtField)
- (NotPromoted)
- ({ T17544.hs:37:16-18 }
- (Unqual
- {OccName: Int})))))))
- (Nothing))))]
+ (Unqual
+ {OccName: Int}))))))
+ (Nothing)))]
({ <no location info> }
[]))))))]
(Nothing)))))
@@ -768,31 +780,35 @@
(Nothing)
(Nothing)
[({ T17544.hs:43:5-18 }
- (XConDecl
- (ConDeclGADTPrefixPs
- [({ T17544.hs:43:5-8 }
- (Unqual
- {OccName: MkD8}))]
- (HsIB
+ (ConDeclGADT
+ (NoExtField)
+ [({ T17544.hs:43:5-8 }
+ (Unqual
+ {OccName: MkD8}))]
+ ({ T17544.hs:43:13-18 }
+ (False))
+ []
+ (Nothing)
+ (PrefixCon
+ [])
+ ({ T17544.hs:43:13-18 }
+ (HsAppTy
(NoExtField)
- ({ T17544.hs:43:13-18 }
- (HsAppTy
+ ({ T17544.hs:43:13-14 }
+ (HsTyVar
(NoExtField)
+ (NotPromoted)
({ T17544.hs:43:13-14 }
- (HsTyVar
- (NoExtField)
- (NotPromoted)
- ({ T17544.hs:43:13-14 }
- (Unqual
- {OccName: D8}))))
+ (Unqual
+ {OccName: D8}))))
+ ({ T17544.hs:43:16-18 }
+ (HsTyVar
+ (NoExtField)
+ (NotPromoted)
({ T17544.hs:43:16-18 }
- (HsTyVar
- (NoExtField)
- (NotPromoted)
- ({ T17544.hs:43:16-18 }
- (Unqual
- {OccName: Int})))))))
- (Nothing))))]
+ (Unqual
+ {OccName: Int}))))))
+ (Nothing)))]
({ <no location info> }
[]))))))]
(Nothing)))))
@@ -900,31 +916,35 @@
(Nothing)
(Nothing)
[({ T17544.hs:49:5-18 }
- (XConDecl
- (ConDeclGADTPrefixPs
- [({ T17544.hs:49:5-8 }
- (Unqual
- {OccName: MkD9}))]
- (HsIB
+ (ConDeclGADT
+ (NoExtField)
+ [({ T17544.hs:49:5-8 }
+ (Unqual
+ {OccName: MkD9}))]
+ ({ T17544.hs:49:13-18 }
+ (False))
+ []
+ (Nothing)
+ (PrefixCon
+ [])
+ ({ T17544.hs:49:13-18 }
+ (HsAppTy
(NoExtField)
- ({ T17544.hs:49:13-18 }
- (HsAppTy
+ ({ T17544.hs:49:13-14 }
+ (HsTyVar
(NoExtField)
+ (NotPromoted)
({ T17544.hs:49:13-14 }
- (HsTyVar
- (NoExtField)
- (NotPromoted)
- ({ T17544.hs:49:13-14 }
- (Unqual
- {OccName: D9}))))
+ (Unqual
+ {OccName: D9}))))
+ ({ T17544.hs:49:16-18 }
+ (HsTyVar
+ (NoExtField)
+ (NotPromoted)
({ T17544.hs:49:16-18 }
- (HsTyVar
- (NoExtField)
- (NotPromoted)
- ({ T17544.hs:49:16-18 }
- (Unqual
- {OccName: Int})))))))
- (Nothing))))]
+ (Unqual
+ {OccName: Int}))))))
+ (Nothing)))]
({ <no location info> }
[]))))))]
(Nothing)))))
@@ -1032,31 +1052,35 @@
(Nothing)
(Nothing)
[({ T17544.hs:55:5-20 }
- (XConDecl
- (ConDeclGADTPrefixPs
- [({ T17544.hs:55:5-9 }
- (Unqual
- {OccName: MkD10}))]
- (HsIB
+ (ConDeclGADT
+ (NoExtField)
+ [({ T17544.hs:55:5-9 }
+ (Unqual
+ {OccName: MkD10}))]
+ ({ T17544.hs:55:14-20 }
+ (False))
+ []
+ (Nothing)
+ (PrefixCon
+ [])
+ ({ T17544.hs:55:14-20 }
+ (HsAppTy
(NoExtField)
- ({ T17544.hs:55:14-20 }
- (HsAppTy
+ ({ T17544.hs:55:14-16 }
+ (HsTyVar
(NoExtField)
+ (NotPromoted)
({ T17544.hs:55:14-16 }
- (HsTyVar
- (NoExtField)
- (NotPromoted)
- ({ T17544.hs:55:14-16 }
- (Unqual
- {OccName: D10}))))
+ (Unqual
+ {OccName: D10}))))
+ ({ T17544.hs:55:18-20 }
+ (HsTyVar
+ (NoExtField)
+ (NotPromoted)
({ T17544.hs:55:18-20 }
- (HsTyVar
- (NoExtField)
- (NotPromoted)
- ({ T17544.hs:55:18-20 }
- (Unqual
- {OccName: Int})))))))
- (Nothing))))]
+ (Unqual
+ {OccName: Int}))))))
+ (Nothing)))]
({ <no location info> }
[]))))))]
(Nothing)))))
=====================================
testsuite/tests/haddock/should_compile_flag_haddock/T17544_kw.stderr
=====================================
@@ -30,24 +30,28 @@
(Nothing)
(Nothing)
[({ T17544_kw.hs:16:9-20 }
- (XConDecl
- (ConDeclGADTPrefixPs
- [({ T17544_kw.hs:16:9-13 }
- (Unqual
- {OccName: MkFoo}))]
- (HsIB
+ (ConDeclGADT
+ (NoExtField)
+ [({ T17544_kw.hs:16:9-13 }
+ (Unqual
+ {OccName: MkFoo}))]
+ ({ T17544_kw.hs:16:18-20 }
+ (False))
+ []
+ (Nothing)
+ (PrefixCon
+ [])
+ ({ T17544_kw.hs:16:18-20 }
+ (HsTyVar
(NoExtField)
+ (NotPromoted)
({ T17544_kw.hs:16:18-20 }
- (HsTyVar
- (NoExtField)
- (NotPromoted)
- ({ T17544_kw.hs:16:18-20 }
- (Unqual
- {OccName: Foo})))))
- (Just
- ({ T17544_kw.hs:15:10-35 }
- (HsDocString
- " Bad comment for MkFoo"))))))]
+ (Unqual
+ {OccName: Foo}))))
+ (Just
+ ({ T17544_kw.hs:15:10-35 }
+ (HsDocString
+ " Bad comment for MkFoo")))))]
({ <no location info> }
[])))))
,({ T17544_kw.hs:(18,1)-(19,26) }
@@ -70,33 +74,34 @@
(Nothing)
(Nothing)
[({ T17544_kw.hs:19:9-26 }
- (XConDecl
- (ConDeclGADTPrefixPs
- [({ T17544_kw.hs:19:9-13 }
- (Unqual
- {OccName: MkBar}))]
- (HsIB
+ (ConDeclGADT
+ (NoExtField)
+ [({ T17544_kw.hs:19:9-13 }
+ (Unqual
+ {OccName: MkBar}))]
+ ({ T17544_kw.hs:19:18-26 }
+ (False))
+ []
+ (Nothing)
+ (PrefixCon
+ [(HsScaled
+ (HsLinearArrow)
+ ({ T17544_kw.hs:19:18-19 }
+ (HsTupleTy
+ (NoExtField)
+ (HsBoxedOrConstraintTuple)
+ [])))])
+ ({ T17544_kw.hs:19:24-26 }
+ (HsTyVar
(NoExtField)
- ({ T17544_kw.hs:19:18-26 }
- (HsFunTy
- (NoExtField)
- (HsUnrestrictedArrow)
- ({ T17544_kw.hs:19:18-19 }
- (HsTupleTy
- (NoExtField)
- (HsBoxedOrConstraintTuple)
- []))
- ({ T17544_kw.hs:19:24-26 }
- (HsTyVar
- (NoExtField)
- (NotPromoted)
- ({ T17544_kw.hs:19:24-26 }
- (Unqual
- {OccName: Bar})))))))
- (Just
- ({ T17544_kw.hs:18:13-38 }
- (HsDocString
- " Bad comment for MkBar"))))))]
+ (NotPromoted)
+ ({ T17544_kw.hs:19:24-26 }
+ (Unqual
+ {OccName: Bar}))))
+ (Just
+ ({ T17544_kw.hs:18:13-38 }
+ (HsDocString
+ " Bad comment for MkBar")))))]
({ <no location info> }
[])))))
,({ T17544_kw.hs:(21,1)-(24,18) }
=====================================
testsuite/tests/parser/should_compile/T15323.stderr
=====================================
@@ -36,67 +36,62 @@
(Nothing)
(Nothing)
[({ T15323.hs:6:5-54 }
- (XConDecl
- (ConDeclGADTPrefixPs
- [({ T15323.hs:6:5-14 }
- (Unqual
- {OccName: TestParens}))]
- (HsIB
+ (ConDeclGADT
+ (NoExtField)
+ [({ T15323.hs:6:5-14 }
+ (Unqual
+ {OccName: TestParens}))]
+ ({ T15323.hs:6:20-54 }
+ (True))
+ [({ T15323.hs:6:27 }
+ (UserTyVar
+ (NoExtField)
+ (SpecifiedSpec)
+ ({ T15323.hs:6:27 }
+ (Unqual
+ {OccName: v}))))]
+ (Just
+ ({ T15323.hs:6:31-36 }
+ [({ T15323.hs:6:31-36 }
+ (HsParTy
+ (NoExtField)
+ ({ T15323.hs:6:32-35 }
+ (HsAppTy
+ (NoExtField)
+ ({ T15323.hs:6:32-33 }
+ (HsTyVar
+ (NoExtField)
+ (NotPromoted)
+ ({ T15323.hs:6:32-33 }
+ (Unqual
+ {OccName: Eq}))))
+ ({ T15323.hs:6:35 }
+ (HsTyVar
+ (NoExtField)
+ (NotPromoted)
+ ({ T15323.hs:6:35 }
+ (Unqual
+ {OccName: v}))))))))]))
+ (PrefixCon
+ [])
+ ({ T15323.hs:6:41-54 }
+ (HsAppTy
(NoExtField)
- ({ T15323.hs:6:20-54 }
- (HsForAllTy
+ ({ T15323.hs:6:41-52 }
+ (HsTyVar
(NoExtField)
- (HsForAllInvis
- (NoExtField)
- [({ T15323.hs:6:27 }
- (UserTyVar
- (NoExtField)
- (SpecifiedSpec)
- ({ T15323.hs:6:27 }
- (Unqual
- {OccName: v}))))])
- ({ T15323.hs:6:31-54 }
- (HsQualTy
- (NoExtField)
- ({ T15323.hs:6:31-36 }
- [({ T15323.hs:6:31-36 }
- (HsParTy
- (NoExtField)
- ({ T15323.hs:6:32-35 }
- (HsAppTy
- (NoExtField)
- ({ T15323.hs:6:32-33 }
- (HsTyVar
- (NoExtField)
- (NotPromoted)
- ({ T15323.hs:6:32-33 }
- (Unqual
- {OccName: Eq}))))
- ({ T15323.hs:6:35 }
- (HsTyVar
- (NoExtField)
- (NotPromoted)
- ({ T15323.hs:6:35 }
- (Unqual
- {OccName: v}))))))))])
- ({ T15323.hs:6:41-54 }
- (HsAppTy
- (NoExtField)
- ({ T15323.hs:6:41-52 }
- (HsTyVar
- (NoExtField)
- (NotPromoted)
- ({ T15323.hs:6:41-52 }
- (Unqual
- {OccName: MaybeDefault}))))
- ({ T15323.hs:6:54 }
- (HsTyVar
- (NoExtField)
- (NotPromoted)
- ({ T15323.hs:6:54 }
- (Unqual
- {OccName: v})))))))))))
- (Nothing))))]
+ (NotPromoted)
+ ({ T15323.hs:6:41-52 }
+ (Unqual
+ {OccName: MaybeDefault}))))
+ ({ T15323.hs:6:54 }
+ (HsTyVar
+ (NoExtField)
+ (NotPromoted)
+ ({ T15323.hs:6:54 }
+ (Unqual
+ {OccName: v}))))))
+ (Nothing)))]
({ <no location info> }
[])))))]
(Nothing)
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/d4d44edbe4f9acbd523b3cc049f9a6ac3f7f0ddd...12957a0b1c74e35f1584b09ba90caa52752be575
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/d4d44edbe4f9acbd523b3cc049f9a6ac3f7f0ddd...12957a0b1c74e35f1584b09ba90caa52752be575
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20200926/2838e9f3/attachment-0001.html>
More information about the ghc-commits
mailing list