import HsPat ( HsConDetails(..), hsConArgs )
import HsImpExp ( pprHsVar )
import HsTypes
+import NameSet ( NameSet )
import HscTypes ( DeprecTxt )
import CoreSyn ( RuleName )
import Kind ( Kind, pprKind )
emptyGroup = HsGroup { hs_tyclds = [], hs_instds = [],
hs_fixds = [], hs_defds = [], hs_fords = [],
- hs_depds = [] ,hs_ruleds = [] }
+ hs_depds = [], hs_ruleds = [],
+ hs_valds = error "emptyGroup hs_valds: Can't happen" }
appendGroups :: HsGroup a -> HsGroup a -> HsGroup a
appendGroups
where
ppr_details (PrefixCon arg_tys) = dcolon <+> ppr (foldr mk_fun_ty res_ty arg_tys)
ppr_details (RecCon fields) = ppr fields <+> dcolon <+> ppr res_ty
- ppr_details (PrefixCon _) = pprPanic "pprConDecl" (ppr con)
mk_fun_ty a b = noLoc (HsFunTy a b)
Activation
[RuleBndr name] -- Forall'd vars; after typechecking this includes tyvars
(Located (HsExpr name)) -- LHS
+ NameSet -- Free-vars from the LHS
(Located (HsExpr name)) -- RHS
+ NameSet -- Free-vars from the RHS
data RuleBndr name
= RuleBndr (Located name)
collectRuleBndrSigTys bndrs = [ty | RuleBndrSig _ ty <- bndrs]
instance OutputableBndr name => Outputable (RuleDecl name) where
- ppr (HsRule name act ns lhs rhs)
+ ppr (HsRule name act ns lhs fv_lhs rhs fv_rhs)
= sep [text "{-# RULES" <+> doubleQuotes (ftext name) <+> ppr act,
nest 4 (pp_forall <+> pprExpr (unLoc lhs)),
nest 4 (equals <+> pprExpr (unLoc rhs) <+> text "#-}") ]