summaryrefslogtreecommitdiff
path: root/compiler/GHC/Iface/Syntax.hs
diff options
context:
space:
mode:
authorCale Gibbard <cgibbard@gmail.com>2021-02-22 15:56:22 -0500
committerSebastian Graf <sebastian.graf@kit.edu>2021-03-02 20:02:28 +0100
commitd793863259ed18b23ea28e9252aaec8d50929685 (patch)
tree68fa3c4d840d261d2bd980643f0082cfcbfe7c34 /compiler/GHC/Iface/Syntax.hs
parent4e28f467b8fe4530dc488ae2577e3100164affa2 (diff)
downloadhaskell-wip/T14422.tar.gz
An initial attempt at type-directed COMPLETE pragmas.wip/T14422
Implement some suggestions from Sebastian Graf Fix a test, add another cmScrutineeType -> cmResultType, and change/add documentation Simplify PmAltConSet to not include type information
Diffstat (limited to 'compiler/GHC/Iface/Syntax.hs')
-rw-r--r--compiler/GHC/Iface/Syntax.hs10
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/GHC/Iface/Syntax.hs b/compiler/GHC/Iface/Syntax.hs
index 21b4274cc7..baaa4c28a3 100644
--- a/compiler/GHC/Iface/Syntax.hs
+++ b/compiler/GHC/Iface/Syntax.hs
@@ -325,12 +325,12 @@ data IfaceAnnotation
type IfaceAnnTarget = AnnTarget OccName
-data IfaceCompleteMatch = IfaceCompleteMatch [IfExtName] (Maybe IfaceTyCon)
+data IfaceCompleteMatch = IfaceCompleteMatch [IfExtName] (Maybe IfaceType)
instance Outputable IfaceCompleteMatch where
- ppr (IfaceCompleteMatch cls mtc) = text "COMPLETE" <> colon <+> ppr cls <+> case mtc of
+ ppr (IfaceCompleteMatch cls mty) = text "COMPLETE" <> colon <+> ppr cls <+> case mty of
Nothing -> empty
- Just tc -> dcolon <+> ppr tc
+ Just ty -> dcolon <+> ppr ty
-- Here's a tricky case:
-- * Compile with -O module A, and B which imports A.f
@@ -2491,7 +2491,7 @@ instance Binary IfaceTyConParent where
return $ IfDataInstance ax pr ty
instance Binary IfaceCompleteMatch where
- put_ bh (IfaceCompleteMatch cs mtc) = put_ bh cs >> put_ bh mtc
+ put_ bh (IfaceCompleteMatch cs mty) = put_ bh cs >> put_ bh mty
get bh = IfaceCompleteMatch <$> get bh <*> get bh
@@ -2651,7 +2651,7 @@ instance NFData IfaceConAlt where
IfaceLitAlt lit -> lit `seq` ()
instance NFData IfaceCompleteMatch where
- rnf (IfaceCompleteMatch f1 mtc) = rnf f1 `seq` rnf mtc
+ rnf (IfaceCompleteMatch f1 mty) = rnf f1 `seq` rnf mty
instance NFData IfaceRule where
rnf (IfaceRule f1 f2 f3 f4 f5 f6 f7 f8) =