[commit: ghc] wip/pattern-synonym-backport: nlHsTyApps: for applying a function both on type- and term-level arguments (8ad7f1a)
git at git.haskell.org
git at git.haskell.org
Sat Dec 20 08:46:45 UTC 2014
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/pattern-synonym-backport
Link : http://ghc.haskell.org/trac/ghc/changeset/8ad7f1a049ffb4ce9bf6f72ee868185c7979285e/ghc
>---------------------------------------------------------------
commit 8ad7f1a049ffb4ce9bf6f72ee868185c7979285e
Author: Dr. ERDI Gergo <gergo at erdi.hu>
Date: Sat Dec 20 10:56:07 2014 +0800
nlHsTyApps: for applying a function both on type- and term-level arguments
(cherry picked from commit faeb0a687ea291cb2d497a7042af4829f55e223d)
>---------------------------------------------------------------
8ad7f1a049ffb4ce9bf6f72ee868185c7979285e
compiler/hsSyn/HsUtils.lhs | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/compiler/hsSyn/HsUtils.lhs b/compiler/hsSyn/HsUtils.lhs
index a5ffda2..23a3cac 100644
--- a/compiler/hsSyn/HsUtils.lhs
+++ b/compiler/hsSyn/HsUtils.lhs
@@ -30,7 +30,7 @@ module HsUtils(
mkHsOpApp, mkHsDo, mkHsComp, mkHsWrapPat, mkHsWrapPatCo,
mkLHsPar, mkHsCmdCast,
- nlHsTyApp, nlHsVar, nlHsLit, nlHsApp, nlHsApps, nlHsIntLit, nlHsVarApps,
+ nlHsTyApp, nlHsTyApps, nlHsVar, nlHsLit, nlHsApp, nlHsApps, nlHsIntLit, nlHsVarApps,
nlHsDo, nlHsOpApp, nlHsLam, nlHsPar, nlHsIf, nlHsCase, nlList,
mkLHsTupleExpr, mkLHsVarTuple, missingTupArg,
toHsType, toHsKind,
@@ -164,6 +164,9 @@ mkSimpleHsAlt pat expr
nlHsTyApp :: name -> [Type] -> LHsExpr name
nlHsTyApp fun_id tys = noLoc (HsWrap (mkWpTyApps tys) (HsVar fun_id))
+nlHsTyApps :: name -> [Type] -> [LHsExpr name] -> LHsExpr name
+nlHsTyApps fun_id tys xs = foldl nlHsApp (nlHsTyApp fun_id tys) xs
+
--------- Adding parens ---------
mkLHsPar :: LHsExpr name -> LHsExpr name
-- Wrap in parens if hsExprNeedsParens says it needs them
More information about the ghc-commits
mailing list