summaryrefslogtreecommitdiff
path: root/compiler/hsSyn/HsExpr.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/hsSyn/HsExpr.hs')
-rw-r--r--compiler/hsSyn/HsExpr.hs16
1 files changed, 16 insertions, 0 deletions
diff --git a/compiler/hsSyn/HsExpr.hs b/compiler/hsSyn/HsExpr.hs
index 8b8b9df255..79d76115c1 100644
--- a/compiler/hsSyn/HsExpr.hs
+++ b/compiler/hsSyn/HsExpr.hs
@@ -36,6 +36,7 @@ import StaticFlags( opt_PprStyle_Debug )
import Outputable
import FastString
import Type
+import Coercion
-- libraries:
import Data.Data hiding (Fixity)
@@ -187,6 +188,15 @@ data HsExpr id
| SectionR (LHsExpr id) -- operator; see Note [Sections in HsSyn]
(LHsExpr id) -- operand
+ -- | Type-signature operator sections
+
+ | TySigSection (LHsType id)
+ (PostRn id [Name]) -- wildcards
+
+ | TySigSectionOut (LHsType Name)
+ (PostTc id Type)
+ (PostTc id Coercion)
+
-- | Used for explicit tuples and sections thereof
--
-- - 'ApiAnnotation.AnnKeywordId' : 'ApiAnnotation.AnnOpen',
@@ -643,6 +653,12 @@ ppr_expr (SectionR op expr)
4 (pp_expr <> rparen)
pp_infixly v = sep [pprInfixOcc v, pp_expr]
+ppr_expr (TySigSection sig _)
+ = hang dcolon 4 (ppr sig)
+
+ppr_expr (TySigSectionOut sig _ _)
+ = hang dcolon 4 (ppr sig)
+
ppr_expr (ExplicitTuple exprs boxity)
= tupleParens (boxityTupleSort boxity) (fcat (ppr_tup_args $ map unLoc exprs))
where