-- False => left-to-right (arg >- f)
SrcLoc
- | HsArrForm -- Command formation, (| e |) cmd1 .. cmdn
+ | HsArrForm -- Command formation, (| e cmd1 .. cmdn |)
(HsExpr id) -- the operator
-- after type-checking, a type abstraction to be
-- applied to the type of the local environment tuple
ppr_expr expr@(HsApp e1 e2)
= let (fun, args) = collect_args expr [] in
- (ppr_expr fun) <+> (sep (map ppr_expr args))
+ (ppr_expr fun) <+> (sep (map pprParendExpr args))
where
collect_args (HsApp fun arg) args = collect_args fun (arg:args)
collect_args fun args = (fun, args)
ppr_expr (HsArrForm (HsVar v) (Just _) [arg1, arg2] _)
= sep [pprCmdArg arg1, hsep [pprInfix v, pprCmdArg arg2]]
ppr_expr (HsArrForm op _ args _)
- = hang (ptext SLIT("(|") <> pprExpr op <> ptext SLIT("|)"))
- 4 (sep (map pprCmdArg args))
+ = hang (ptext SLIT("(|") <> pprExpr op)
+ 4 (sep (map pprCmdArg args) <> ptext SLIT("|)"))
pprCmdArg :: OutputableBndr id => HsCmdTop id -> SDoc
pprCmdArg (HsCmdTop cmd@(HsArrForm _ Nothing [] _) _ _ _) = pprExpr cmd
| HsArrForm ... -- as above
+ | HsApp (HsCmd id)
+ (HsExpr id)
+
| HsLam (Match id) -- kappa
-- the renamer turns this one into HsArrForm