summaryrefslogtreecommitdiff
path: root/compiler/hsSyn/HsTypes.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/hsSyn/HsTypes.hs')
-rw-r--r--compiler/hsSyn/HsTypes.hs9
1 files changed, 9 insertions, 0 deletions
diff --git a/compiler/hsSyn/HsTypes.hs b/compiler/hsSyn/HsTypes.hs
index b186b36abb..130e39efab 100644
--- a/compiler/hsSyn/HsTypes.hs
+++ b/compiler/hsSyn/HsTypes.hs
@@ -62,6 +62,7 @@ module HsTypes (
mkHsOpTy, mkHsAppTy, mkHsAppTys, mkHsAppKindTy,
ignoreParens, hsSigType, hsSigWcType,
hsLTyVarBndrToType, hsLTyVarBndrsToTypes,
+ hsConDetailsArgs,
-- Printing
pprHsType, pprHsForAll, pprHsForAllExtra, pprHsExplicitForAll,
@@ -912,6 +913,14 @@ instance (Outputable arg, Outputable rec)
ppr (RecCon rec) = text "RecCon:" <+> ppr rec
ppr (InfixCon l r) = text "InfixCon:" <+> ppr [l, r]
+hsConDetailsArgs ::
+ HsConDetails (LHsType a) (Located [LConDeclField a])
+ -> [LHsType a]
+hsConDetailsArgs details = case details of
+ InfixCon a b -> [a,b]
+ PrefixCon xs -> xs
+ RecCon r -> map (cd_fld_type . unLoc) (unLoc r)
+
{-
Note [ConDeclField passs]
~~~~~~~~~~~~~~~~~~~~~~~~~