diff options
| author | Ben Gamari <bgamari.foss@gmail.com> | 2018-06-02 11:56:58 -0400 |
|---|---|---|
| committer | Ben Gamari <ben@smart-cactus.org> | 2018-06-02 16:21:12 -0400 |
| commit | faee23bb69ca813296da484bc177f4480bcaee9f (patch) | |
| tree | 28e1c99f0de9d505c1df81ae7459839f5db4121c /compiler/hsSyn | |
| parent | 13a86606e51400bc2a81a0e04cfbb94ada5d2620 (diff) | |
| download | haskell-faee23bb69ca813296da484bc177f4480bcaee9f.tar.gz | |
vectorise: Put it out of its misery
Poor DPH and its vectoriser have long been languishing; sadly it seems there is
little chance that the effort will be rekindled. Every few years we discuss
what to do with this mass of code and at least once we have agreed that it
should be archived on a branch and removed from `master`. Here we do just that,
eliminating heaps of dead code in the process.
Here we drop the ParallelArrays extension, the vectoriser, and the `vector` and
`primitive` submodules.
Test Plan: Validate
Reviewers: simonpj, simonmar, hvr, goldfire, alanz
Reviewed By: simonmar
Subscribers: goldfire, rwbarton, thomie, mpickering, carter
Differential Revision: https://phabricator.haskell.org/D4761
Diffstat (limited to 'compiler/hsSyn')
| -rw-r--r-- | compiler/hsSyn/HsDecls.hs | 153 | ||||
| -rw-r--r-- | compiler/hsSyn/HsExpr.hs | 56 | ||||
| -rw-r--r-- | compiler/hsSyn/HsExtension.hs | 39 | ||||
| -rw-r--r-- | compiler/hsSyn/HsInstances.hs | 10 | ||||
| -rw-r--r-- | compiler/hsSyn/HsPat.hs | 13 | ||||
| -rw-r--r-- | compiler/hsSyn/HsTypes.hs | 10 | ||||
| -rw-r--r-- | compiler/hsSyn/HsUtils.hs | 2 |
7 files changed, 7 insertions, 276 deletions
diff --git a/compiler/hsSyn/HsDecls.hs b/compiler/hsSyn/HsDecls.hs index 10f09da558..d389f61e86 100644 --- a/compiler/hsSyn/HsDecls.hs +++ b/compiler/hsSyn/HsDecls.hs @@ -50,9 +50,6 @@ module HsDecls ( RuleBndr(..),LRuleBndr, collectRuleBndrSigTys, flattenRuleDecls, pprFullRuleName, - -- ** @VECTORISE@ declarations - VectDecl(..), LVectDecl,VectTypePR(..),VectTypeTc(..),VectClassPR(..), - lvectDeclName, lvectInstDecl, -- ** @default@ declarations DefaultDecl(..), LDefaultDecl, -- ** Template haskell declaration splice @@ -87,7 +84,7 @@ module HsDecls ( -- friends: import GhcPrelude -import {-# SOURCE #-} HsExpr( LHsExpr, HsExpr, HsSplice, pprExpr, +import {-# SOURCE #-} HsExpr( HsExpr, HsSplice, pprExpr, pprSpliceDecl ) -- Because Expr imports Decls via HsBracket @@ -95,7 +92,6 @@ import HsBinds import HsTypes import HsDoc import TyCon -import Name import BasicTypes import Coercion import ForeignCall @@ -103,7 +99,6 @@ import HsExtension import NameSet -- others: -import InstEnv import Class import Outputable import Util @@ -141,7 +136,6 @@ data HsDecl p | WarningD (XWarningD p) (WarnDecls p) -- ^ Warning declaration | AnnD (XAnnD p) (AnnDecl p) -- ^ Annotation declaration | RuleD (XRuleD p) (RuleDecls p) -- ^ Rule declaration - | VectD (XVectD p) (VectDecl p) -- ^ Vectorise declaration | SpliceD (XSpliceD p) (SpliceDecl p) -- ^ Splice declaration -- (Includes quasi-quotes) | DocD (XDocD p) (DocDecl) -- ^ Documentation comment declaration @@ -158,7 +152,6 @@ type instance XForD (GhcPass _) = NoExt type instance XWarningD (GhcPass _) = NoExt type instance XAnnD (GhcPass _) = NoExt type instance XRuleD (GhcPass _) = NoExt -type instance XVectD (GhcPass _) = NoExt type instance XSpliceD (GhcPass _) = NoExt type instance XDocD (GhcPass _) = NoExt type instance XRoleAnnotD (GhcPass _) = NoExt @@ -204,7 +197,6 @@ data HsGroup p hs_warnds :: [LWarnDecls p], hs_annds :: [LAnnDecl p], hs_ruleds :: [LRuleDecls p], - hs_vects :: [LVectDecl p], hs_docs :: [LDocDecl] } @@ -225,7 +217,7 @@ emptyGroup = HsGroup { hs_ext = noExt, hs_tyclds = [], hs_derivds = [], hs_fixds = [], hs_defds = [], hs_annds = [], - hs_fords = [], hs_warnds = [], hs_ruleds = [], hs_vects = [], + hs_fords = [], hs_warnds = [], hs_ruleds = [], hs_valds = error "emptyGroup hs_valds: Can't happen", hs_splcds = [], hs_docs = [] } @@ -244,8 +236,7 @@ appendGroups hs_fords = fords1, hs_warnds = warnds1, hs_ruleds = rulds1, - hs_vects = vects1, - hs_docs = docs1 } + hs_docs = docs1 } HsGroup { hs_valds = val_groups2, hs_splcds = spliceds2, @@ -257,7 +248,6 @@ appendGroups hs_fords = fords2, hs_warnds = warnds2, hs_ruleds = rulds2, - hs_vects = vects2, hs_docs = docs2 } = HsGroup { @@ -272,7 +262,6 @@ appendGroups hs_fords = fords1 ++ fords2, hs_warnds = warnds1 ++ warnds2, hs_ruleds = rulds1 ++ rulds2, - hs_vects = vects1 ++ vects2, hs_docs = docs1 ++ docs2 } appendGroups _ _ = panic "appendGroups" @@ -285,7 +274,6 @@ instance (p ~ GhcPass pass, OutputableBndrId p) => Outputable (HsDecl p) where ppr (ForD _ fd) = ppr fd ppr (SigD _ sd) = ppr sd ppr (RuleD _ rd) = ppr rd - ppr (VectD _ vect) = ppr vect ppr (WarningD _ wd) = ppr wd ppr (AnnD _ ad) = ppr ad ppr (SpliceD _ dd) = ppr dd @@ -302,13 +290,11 @@ instance (p ~ GhcPass pass, OutputableBndrId p) => Outputable (HsGroup p) where hs_annds = ann_decls, hs_fords = foreign_decls, hs_defds = default_decls, - hs_ruleds = rule_decls, - hs_vects = vect_decls }) + hs_ruleds = rule_decls }) = vcat_mb empty [ppr_ds fix_decls, ppr_ds default_decls, ppr_ds deprec_decls, ppr_ds ann_decls, ppr_ds rule_decls, - ppr_ds vect_decls, if isEmptyValBinds val_decls then Nothing else Just (ppr val_decls), @@ -2106,137 +2092,6 @@ instance (p ~ GhcPass pass, OutputableBndrId p) => Outputable (RuleBndr p) where {- ************************************************************************ * * -\subsection{Vectorisation declarations} -* * -************************************************************************ - -A vectorisation pragma, one of - - {-# VECTORISE f = closure1 g (scalar_map g) #-} - {-# VECTORISE SCALAR f #-} - {-# NOVECTORISE f #-} - - {-# VECTORISE type T = ty #-} - {-# VECTORISE SCALAR type T #-} --} - --- | Located Vectorise Declaration -type LVectDecl pass = Located (VectDecl pass) - --- | Vectorise Declaration -data VectDecl pass - = HsVect - (XHsVect pass) - SourceText -- Note [Pragma source text] in BasicTypes - (Located (IdP pass)) - (LHsExpr pass) - -- ^ - 'ApiAnnotation.AnnKeywordId' : 'ApiAnnotation.AnnOpen', - -- 'ApiAnnotation.AnnEqual','ApiAnnotation.AnnClose' - - -- For details on above see note [Api annotations] in ApiAnnotation - | HsNoVect - (XHsNoVect pass) - SourceText -- Note [Pragma source text] in BasicTypes - (Located (IdP pass)) - -- ^ - 'ApiAnnotation.AnnKeywordId' : 'ApiAnnotation.AnnOpen', - -- 'ApiAnnotation.AnnClose' - - -- For details on above see note [Api annotations] in ApiAnnotation - | HsVectType - (XHsVectType pass) - Bool -- 'TRUE' => SCALAR declaration - | HsVectClass -- pre type-checking - (XHsVectClass pass) - | HsVectInst -- pre type-checking (always SCALAR) - -- !!!FIXME: should be superfluous now - (XHsVectInst pass) - | XVectDecl (XXVectDecl pass) - --- Used for XHsVectType for parser and renamer phases -data VectTypePR pass - = VectTypePR - SourceText -- Note [Pragma source text] in BasicTypes - (Located (IdP pass)) - (Maybe (Located (IdP pass))) -- 'Nothing' => no right-hand side - --- Used for XHsVectType -data VectTypeTc - = VectTypeTc - TyCon - (Maybe TyCon) -- 'Nothing' => no right-hand side - deriving Data - --- Used for XHsVectClass for parser and renamer phases -data VectClassPR pass - = VectClassPR - SourceText -- Note [Pragma source text] in BasicTypes - (Located (IdP pass)) - -type instance XHsVect (GhcPass _) = NoExt -type instance XHsNoVect (GhcPass _) = NoExt - -type instance XHsVectType GhcPs = VectTypePR GhcPs -type instance XHsVectType GhcRn = VectTypePR GhcRn -type instance XHsVectType GhcTc = VectTypeTc - -type instance XHsVectClass GhcPs = VectClassPR GhcPs -type instance XHsVectClass GhcRn = VectClassPR GhcRn -type instance XHsVectClass GhcTc = Class - -type instance XHsVectInst GhcPs = (LHsSigType GhcPs) -type instance XHsVectInst GhcRn = (LHsSigType GhcRn) -type instance XHsVectInst GhcTc = ClsInst - -type instance XXVectDecl (GhcPass _) = NoExt - - -lvectDeclName :: LVectDecl GhcTc -> Name -lvectDeclName (L _ (HsVect _ _ (L _ name) _)) = getName name -lvectDeclName (L _ (HsNoVect _ _ (L _ name))) = getName name -lvectDeclName (L _ (HsVectType (VectTypeTc tycon _) _)) = getName tycon -lvectDeclName (L _ (HsVectClass cls)) = getName cls -lvectDeclName (L _ (HsVectInst {})) - = panic "HsDecls.lvectDeclName: HsVectInst" -lvectDeclName (L _ (XVectDecl {})) - = panic "HsDecls.lvectDeclName: XVectDecl" - -lvectInstDecl :: LVectDecl pass -> Bool -lvectInstDecl (L _ (HsVectInst {})) = True -lvectInstDecl _ = False - -instance (p ~ GhcPass pass, OutputableBndrId p) => Outputable (VectDecl p) where - ppr (HsVect _ _ v rhs) - = sep [text "{-# VECTORISE" <+> ppr v, - nest 4 $ - pprExpr (unLoc rhs) <+> text "#-}" ] - ppr (HsNoVect _ _ v) - = sep [text "{-# NOVECTORISE" <+> ppr v <+> text "#-}" ] - ppr (HsVectType x False) - = sep [text "{-# VECTORISE type" <+> ppr x <+> text "#-}" ] - ppr (HsVectType x True) - = sep [text "{-# VECTORISE SCALAR type" <+> ppr x <+> text "#-}" ] - ppr (HsVectClass c) - = sep [text "{-# VECTORISE class" <+> ppr c <+> text "#-}" ] - ppr (HsVectInst i) - = sep [text "{-# VECTORISE SCALAR instance" <+> ppr i <+> text "#-}" ] - ppr (XVectDecl x) = ppr x - -instance (p ~ GhcPass pass, OutputableBndrId p) - => Outputable (VectTypePR p) where - ppr (VectTypePR _ n Nothing) = ppr n - ppr (VectTypePR _ n (Just t)) = sep [ppr n, text "=", ppr t] - -instance Outputable VectTypeTc where - ppr (VectTypeTc n Nothing) = ppr n - ppr (VectTypeTc n (Just t)) = sep [ppr n, text "=", ppr t] - -instance (p ~ GhcPass pass, OutputableBndrId p) - => Outputable (VectClassPR p) where - ppr (VectClassPR _ n ) = ppr n - -{- -************************************************************************ -* * \subsection[DocDecl]{Document comments} * * ************************************************************************ diff --git a/compiler/hsSyn/HsExpr.hs b/compiler/hsSyn/HsExpr.hs index 19cb70d6f3..96d86c871b 100644 --- a/compiler/hsSyn/HsExpr.hs +++ b/compiler/hsSyn/HsExpr.hs @@ -460,18 +460,6 @@ data HsExpr p -- For OverloadedLists, the fromListN witness [LHsExpr p] - -- | Syntactic parallel array: [:e1, ..., en:] - -- - -- - 'ApiAnnotation.AnnKeywordId' : 'ApiAnnotation.AnnOpen' @'[:'@, - -- 'ApiAnnotation.AnnDotdot','ApiAnnotation.AnnComma', - -- 'ApiAnnotation.AnnVbar' - -- 'ApiAnnotation.AnnClose' @':]'@ - - -- For details on above see note [Api annotations] in ApiAnnotation - | ExplicitPArr - (XExplicitPArr p) -- type of elements of the parallel array - [LHsExpr p] - -- | Record construction -- -- - 'ApiAnnotation.AnnKeywordId' : 'ApiAnnotation.AnnOpen' @'{'@, @@ -522,24 +510,6 @@ data HsExpr p -- For OverloadedLists, the fromList witness (ArithSeqInfo p) - -- | Arithmetic sequence for parallel array - -- - -- > [:e1..e2:] or [:e1, e2..e3:] - -- - -- - 'ApiAnnotation.AnnKeywordId' : 'ApiAnnotation.AnnOpen' @'[:'@, - -- 'ApiAnnotation.AnnComma','ApiAnnotation.AnnDotdot', - -- 'ApiAnnotation.AnnVbar', - -- 'ApiAnnotation.AnnClose' @':]'@ - - -- For details on above see note [Api annotations] in ApiAnnotation - | PArrSeq - (XPArrSeq p) - (ArithSeqInfo p) - - -- | - 'ApiAnnotation.AnnKeywordId' : 'ApiAnnotation.AnnOpen' @'{-\# SCC'@, - -- 'ApiAnnotation.AnnVal' or 'ApiAnnotation.AnnValStr', - -- 'ApiAnnotation.AnnClose' @'\#-}'@ - -- For details on above see note [Api annotations] in ApiAnnotation | HsSCC (XSCC p) SourceText -- Note [Pragma source text] in BasicTypes @@ -781,10 +751,6 @@ type instance XExplicitList GhcPs = NoExt type instance XExplicitList GhcRn = NoExt type instance XExplicitList GhcTc = Type -type instance XExplicitPArr GhcPs = NoExt -type instance XExplicitPArr GhcRn = NoExt -type instance XExplicitPArr GhcTc = Type - type instance XRecordCon GhcPs = NoExt type instance XRecordCon GhcRn = NoExt type instance XRecordCon GhcTc = RecordConTc @@ -801,10 +767,6 @@ type instance XArithSeq GhcPs = NoExt type instance XArithSeq GhcRn = NoExt type instance XArithSeq GhcTc = PostTcExpr -type instance XPArrSeq GhcPs = NoExt -type instance XPArrSeq GhcRn = NoExt -type instance XPArrSeq GhcTc = PostTcExpr - type instance XSCC (GhcPass _) = NoExt type instance XCoreAnn (GhcPass _) = NoExt type instance XBracket (GhcPass _) = NoExt @@ -1111,9 +1073,6 @@ ppr_expr (HsDo _ do_or_list_comp (L _ stmts)) = pprDo do_or_list_comp stmts ppr_expr (ExplicitList _ _ exprs) = brackets (pprDeeperList fsep (punctuate comma (map ppr_lexpr exprs))) -ppr_expr (ExplicitPArr _ exprs) - = paBrackets (pprDeeperList fsep (punctuate comma (map ppr_lexpr exprs))) - ppr_expr (RecordCon { rcon_con_name = con_id, rcon_flds = rbinds }) = hang (ppr con_id) 2 (ppr rbinds) @@ -1125,7 +1084,6 @@ ppr_expr (ExprWithTySig sig expr) 4 (ppr sig) ppr_expr (ArithSeq _ _ info) = brackets (ppr info) -ppr_expr (PArrSeq _ info) = paBrackets (ppr info) ppr_expr (EWildPat _) = char '_' ppr_expr (ELazyPat _ e) = char '~' <> ppr e @@ -1279,11 +1237,9 @@ hsExprNeedsParens p = go | isListCompExpr sc = False | otherwise = p > topPrec go (ExplicitList{}) = False - go (ExplicitPArr{}) = False go (RecordUpd{}) = False go (ExprWithTySig{}) = p > topPrec go (ArithSeq{}) = False - go (PArrSeq{}) = False go (EWildPat{}) = False go (ELazyPat{}) = False go (EAsPat{}) = False @@ -1891,14 +1847,14 @@ type GhciStmt id = Stmt id (LHsExpr id) -- For details on above see note [Api annotations] in ApiAnnotation data StmtLR idL idR body -- body should always be (LHs**** idR) - = LastStmt -- Always the last Stmt in ListComp, MonadComp, PArrComp, + = LastStmt -- Always the last Stmt in ListComp, MonadComp, -- and (after the renamer) DoExpr, MDoExpr -- Not used for GhciStmtCtxt, PatGuard, which scope over other stuff (XLastStmt idL idR body) body Bool -- True <=> return was stripped by ApplicativeDo (SyntaxExpr idR) -- The return operator, used only for - -- MonadComp For ListComp, PArrComp, we + -- MonadComp For ListComp we -- use the baked-in 'return' For DoExpr, -- MDoExpr, we don't apply a 'return' at -- all See Note [Monad Comprehensions] | @@ -2374,7 +2330,6 @@ pprDo GhciStmtCtxt stmts = text "do" <+> ppr_do_stmts stmts pprDo ArrowExpr stmts = text "do" <+> ppr_do_stmts stmts pprDo MDoExpr stmts = text "mdo" <+> ppr_do_stmts stmts pprDo ListComp stmts = brackets $ pprComp stmts -pprDo PArrComp stmts = paBrackets $ pprComp stmts pprDo MonadComp stmts = brackets $ pprComp stmts pprDo _ _ = panic "pprDo" -- PatGuard, ParStmtCxt @@ -2778,7 +2733,6 @@ isPatSynCtxt ctxt = data HsStmtContext id = ListComp | MonadComp - | PArrComp -- ^Parallel array comprehension | DoExpr -- ^do { ... } | MDoExpr -- ^mdo { ... } ie recursive do-expression @@ -2794,7 +2748,6 @@ deriving instance (Data id) => Data (HsStmtContext id) isListCompExpr :: HsStmtContext id -> Bool -- Uses syntax [ e | quals ] isListCompExpr ListComp = True -isListCompExpr PArrComp = True isListCompExpr MonadComp = True isListCompExpr (ParStmtCtxt c) = isListCompExpr c isListCompExpr (TransStmtCtxt c) = isListCompExpr c @@ -2809,7 +2762,7 @@ isMonadFailStmtContext MDoExpr = True isMonadFailStmtContext GhciStmtCtxt = True isMonadFailStmtContext (ParStmtCtxt ctxt) = isMonadFailStmtContext ctxt isMonadFailStmtContext (TransStmtCtxt ctxt) = isMonadFailStmtContext ctxt -isMonadFailStmtContext _ = False -- ListComp, PArrComp, PatGuard, ArrowExpr +isMonadFailStmtContext _ = False -- ListComp, PatGuard, ArrowExpr matchSeparator :: HsMatchContext id -> SDoc matchSeparator (FunRhs {}) = text "=" @@ -2864,7 +2817,6 @@ pprAStmtContext ctxt = article <+> pprStmtContext ctxt pp_a = text "a" article = case ctxt of MDoExpr -> pp_an - PArrComp -> pp_an GhciStmtCtxt -> pp_an _ -> pp_a @@ -2876,7 +2828,6 @@ pprStmtContext MDoExpr = text "'mdo' block" pprStmtContext ArrowExpr = text "'do' block in an arrow command" pprStmtContext ListComp = text "list comprehension" pprStmtContext MonadComp = text "monad comprehension" -pprStmtContext PArrComp = text "array comprehension" pprStmtContext (PatGuard ctxt) = text "pattern guard for" $$ pprMatchContext ctxt -- Drop the inner contexts when reporting errors, else we get @@ -2918,7 +2869,6 @@ matchContextErrString (StmtCtxt ArrowExpr) = text "'do' block" matchContextErrString (StmtCtxt MDoExpr) = text "'mdo' block" matchContextErrString (StmtCtxt ListComp) = text "list comprehension" matchContextErrString (StmtCtxt MonadComp) = text "monad comprehension" -matchContextErrString (StmtCtxt PArrComp) = text "array comprehension" pprMatchInCtxt :: (OutputableBndrId (GhcPass idR), -- TODO:AZ these constraints do not make sense diff --git a/compiler/hsSyn/HsExtension.hs b/compiler/hsSyn/HsExtension.hs index 4545b2b0cb..4898e36e3b 100644 --- a/compiler/hsSyn/HsExtension.hs +++ b/compiler/hsSyn/HsExtension.hs @@ -216,7 +216,6 @@ type family XForD x type family XWarningD x type family XAnnD x type family XRuleD x -type family XVectD x type family XSpliceD x type family XDocD x type family XRoleAnnotD x @@ -233,7 +232,6 @@ type ForallXHsDecl (c :: * -> Constraint) (x :: *) = , c (XWarningD x) , c (XAnnD x) , c (XRuleD x) - , c (XVectD x) , c (XSpliceD x) , c (XDocD x) , c (XRoleAnnotD x) @@ -442,25 +440,6 @@ type ForallXRuleBndr (c :: * -> Constraint) (x :: *) = ) -- ------------------------------------- --- RuleBndr type families -type family XHsVect x -type family XHsNoVect x -type family XHsVectType x -type family XHsVectClass x -type family XHsVectInst x -type family XXVectDecl x - -type ForallXVectDecl (c :: * -> Constraint) (x :: *) = - ( c (XHsVect x) - , c (XHsNoVect x) - , c (XHsVectType x) - , c (XHsVectClass x) - , c (XHsVectInst x) - , c (XXVectDecl x) - , c (XXVectDecl x) - ) - --- ------------------------------------- -- WarnDecls type families type family XWarnings x type family XXWarnDecls x @@ -528,12 +507,10 @@ type family XMultiIf x type family XLet x type family XDo x type family XExplicitList x -type family XExplicitPArr x type family XRecordCon x type family XRecordUpd x type family XExprWithTySig x type family XArithSeq x -type family XPArrSeq x type family XSCC x type family XCoreAnn x type family XBracket x @@ -580,12 +557,10 @@ type ForallXExpr (c :: * -> Constraint) (x :: *) = , c (XLet x) , c (XDo x) , c (XExplicitList x) - , c (XExplicitPArr x) , c (XRecordCon x) , c (XRecordUpd x) , c (XExprWithTySig x) , c (XArithSeq x) - , c (XPArrSeq x) , c (XSCC x) , c (XCoreAnn x) , c (XBracket x) @@ -856,7 +831,6 @@ type family XBangPat x type family XListPat x type family XTuplePat x type family XSumPat x -type family XPArrPat x type family XConPat x type family XViewPat x type family XSplicePat x @@ -878,7 +852,6 @@ type ForallXPat (c :: * -> Constraint) (x :: *) = , c (XListPat x) , c (XTuplePat x) , c (XSumPat x) - , c (XPArrPat x) , c (XViewPat x) , c (XSplicePat x) , c (XLitPat x) @@ -929,7 +902,6 @@ type family XAppsTy x type family XAppTy x type family XFunTy x type family XListTy x -type family XPArrTy x type family XTupleTy x type family XSumTy x type family XOpTy x @@ -957,7 +929,6 @@ type ForallXType (c :: * -> Constraint) (x :: *) = , c (XAppTy x) , c (XFunTy x) , c (XListTy x) - , c (XPArrTy x) , c (XTupleTy x) , c (XSumTy x) , c (XOpTy x) @@ -1129,16 +1100,6 @@ type OutputableX p = -- See Note [OutputableX] , Outputable (XAppTypeE p) , Outputable (XAppTypeE GhcRn) - - , Outputable (XHsVectType p) - , Outputable (XHsVectType GhcRn) - - , Outputable (XHsVectClass p) - , Outputable (XHsVectClass GhcRn) - - , Outputable (XHsVectInst p) - , Outputable (XHsVectInst GhcRn) - ) -- TODO: Should OutputableX be included in OutputableBndrId? diff --git a/compiler/hsSyn/HsInstances.hs b/compiler/hsSyn/HsInstances.hs index 5833e17ff1..be72ec7939 100644 --- a/compiler/hsSyn/HsInstances.hs +++ b/compiler/hsSyn/HsInstances.hs @@ -209,16 +209,6 @@ deriving instance Data (RuleBndr GhcPs) deriving instance Data (RuleBndr GhcRn) deriving instance Data (RuleBndr GhcTc) --- deriving instance (DataIdLR p p) => Data (VectDecl p) -deriving instance Data (VectDecl GhcPs) -deriving instance Data (VectDecl GhcRn) -deriving instance Data (VectDecl GhcTc) - -deriving instance Data (VectTypePR GhcPs) -deriving instance Data (VectTypePR GhcRn) -deriving instance Data (VectClassPR GhcPs) -deriving instance Data (VectClassPR GhcRn) - -- deriving instance (DataId p) => Data (WarnDecls p) deriving instance Data (WarnDecls GhcPs) deriving instance Data (WarnDecls GhcRn) diff --git a/compiler/hsSyn/HsPat.hs b/compiler/hsSyn/HsPat.hs index 6c092d34a7..866b0e2b3a 100644 --- a/compiler/hsSyn/HsPat.hs +++ b/compiler/hsSyn/HsPat.hs @@ -166,12 +166,7 @@ data Pat p -- 'ApiAnnotation.AnnClose' @'#)'@ -- For details on above see note [Api annotations] in ApiAnnotation - | PArrPat (XPArrPat p) -- After typechecking, the type of the elements - [LPat p] -- Syntactic parallel array - -- ^ - 'ApiAnnotation.AnnKeywordId' : 'ApiAnnotation.AnnOpen' @'[:'@, - -- 'ApiAnnotation.AnnClose' @':]'@ - -- For details on above see note [Api annotations] in ApiAnnotation ------------ Constructor patterns --------------- | ConPatIn (Located (IdP p)) (HsConPatDetails p) @@ -309,10 +304,6 @@ type instance XSumPat GhcPs = NoExt type instance XSumPat GhcRn = NoExt type instance XSumPat GhcTc = [Type] -type instance XPArrPat GhcPs = NoExt -type instance XPArrPat GhcRn = NoExt -type instance XPArrPat GhcTc = Type - type instance XViewPat GhcPs = NoExt type instance XViewPat GhcRn = NoExt type instance XViewPat GhcTc = Type @@ -535,7 +526,6 @@ pprPat (CoPat _ co pat _) = pprHsWrapper co $ \parens else pprPat pat pprPat (SigPat ty pat) = ppr pat <+> dcolon <+> ppr ty pprPat (ListPat _ pats) = brackets (interpp'SP pats) -pprPat (PArrPat _ pats) = paBrackets (interpp'SP pats) pprPat (TuplePat _ pats bx) = tupleParens (boxityTupleSort bx) (pprWithCommas ppr pats) pprPat (SumPat _ pat alt arity) = sumParens (pprAlternative ppr pat alt arity) @@ -694,7 +684,6 @@ isIrrefutableHsPat pat go1 (SumPat {}) = False -- See Note [Unboxed sum patterns aren't irrefutable] go1 (ListPat {}) = False - go1 (PArrPat {}) = False -- ? go1 (ConPatIn {}) = False -- Conservative go1 (ConPatOut{ pat_con = L _ (RealDataCon con), pat_args = details }) @@ -758,7 +747,6 @@ patNeedsParens p = go go (TuplePat {}) = False go (SumPat {}) = False go (ListPat {}) = False - go (PArrPat {}) = False go (LitPat _ l) = hsLitNeedsParens p l go (NPat _ (L _ ol) _ _) = hsOverLitNeedsParens p ol go (XPat {}) = True -- conservative default @@ -800,7 +788,6 @@ collectEvVarsPat pat = ListPat _ ps -> unionManyBags $ map collectEvVarsLPat ps TuplePat _ ps _ -> unionManyBags $ map collectEvVarsLPat ps SumPat _ p _ _ -> collectEvVarsLPat p - PArrPat _ ps -> unionManyBags $ map collectEvVarsLPat ps ConPatOut {pat_dicts = dicts, pat_args = args} -> unionBags (listToBag dicts) $ unionManyBags diff --git a/compiler/hsSyn/HsTypes.hs b/compiler/hsSyn/HsTypes.hs index af64c2c69f..11d301d816 100644 --- a/compiler/hsSyn/HsTypes.hs +++ b/compiler/hsSyn/HsTypes.hs @@ -513,13 +513,6 @@ data HsType pass -- For details on above see note [Api annotations] in ApiAnnotation - | HsPArrTy (XPArrTy pass) - (LHsType pass) -- Elem. type of parallel array: [:t:] - -- ^ - 'ApiAnnotation.AnnKeywordId' : 'ApiAnnotation.AnnOpen' @'[:'@, - -- 'ApiAnnotation.AnnClose' @':]'@ - - -- For details on above see note [Api annotations] in ApiAnnotation - | HsTupleTy (XTupleTy pass) HsTupleSort [LHsType pass] -- Element types (length gives arity) @@ -669,7 +662,6 @@ type instance XAppsTy (GhcPass _) = NoExt type instance XAppTy (GhcPass _) = NoExt type instance XFunTy (GhcPass _) = NoExt type instance XListTy (GhcPass _) = NoExt -type instance XPArrTy (GhcPass _) = NoExt type instance XTupleTy (GhcPass _) = NoExt type instance XSumTy (GhcPass _) = NoExt type instance XOpTy (GhcPass _) = NoExt @@ -1454,7 +1446,6 @@ ppr_mono_ty (HsSumTy _ tys) ppr_mono_ty (HsKindSig _ ty kind) = parens (ppr_mono_lty ty <+> dcolon <+> ppr kind) ppr_mono_ty (HsListTy _ ty) = brackets (ppr_mono_lty ty) -ppr_mono_ty (HsPArrTy _ ty) = paBrackets (ppr_mono_lty ty) ppr_mono_ty (HsIParamTy _ n ty) = (ppr n <+> dcolon <+> ppr_mono_lty ty) ppr_mono_ty (HsSpliceTy _ s) = pprSplice s ppr_mono_ty (HsExplicitListTy _ Promoted tys) @@ -1535,7 +1526,6 @@ hsTypeNeedsParens p = go go (HsSumTy{}) = False go (HsKindSig{}) = False go (HsListTy{}) = False - go (HsPArrTy{}) = False go (HsIParamTy{}) = p > topPrec go (HsSpliceTy{}) = False go (HsExplicitListTy{}) = False diff --git a/compiler/hsSyn/HsUtils.hs b/compiler/hsSyn/HsUtils.hs index fe22fb3f28..39149d00f7 100644 --- a/compiler/hsSyn/HsUtils.hs +++ b/compiler/hsSyn/HsUtils.hs @@ -1054,7 +1054,6 @@ collect_lpat (L _ pat) bndrs go (ParPat _ pat) = collect_lpat pat bndrs go (ListPat _ pats) = foldr collect_lpat bndrs pats - go (PArrPat _ pats) = foldr collect_lpat bndrs pats go (TuplePat _ pats _) = foldr collect_lpat bndrs pats go (SumPat _ pat _ _) = collect_lpat pat bndrs @@ -1345,7 +1344,6 @@ lPatImplicits = hs_lpat hs_pat (ViewPat _ _ pat) = hs_lpat pat hs_pat (ParPat _ pat) = hs_lpat pat hs_pat (ListPat _ pats) = hs_lpats pats - hs_pat (PArrPat _ pats) = hs_lpats pats hs_pat (TuplePat _ pats _) = hs_lpats pats hs_pat (SigPat _ pat) = hs_lpat pat |
