summaryrefslogtreecommitdiff
path: root/ghc/compiler/typecheck/TcArrows.lhs
diff options
context:
space:
mode:
authorross <unknown>2003-07-16 08:49:05 +0000
committerross <unknown>2003-07-16 08:49:05 +0000
commit98232a6130f0661486899530fa3461e32499366f (patch)
tree3759045c6954bf8094c222aed3b1321ca029131b /ghc/compiler/typecheck/TcArrows.lhs
parent5ac88b392b71f7d9c71584df76b461bda19f91f4 (diff)
downloadhaskell-98232a6130f0661486899530fa3461e32499366f.tar.gz
[project @ 2003-07-16 08:49:01 by ross]
Arrow notation: add a new (more primitive) form of command: cmd ::= ... | cmd aexp analogous to ordinary application, and also represented using HsApp. To avoid an overlap, the syntax for combining forms is changed to (|aexp cmd1 ... cmdn|)
Diffstat (limited to 'ghc/compiler/typecheck/TcArrows.lhs')
-rw-r--r--ghc/compiler/typecheck/TcArrows.lhs12
1 files changed, 12 insertions, 0 deletions
diff --git a/ghc/compiler/typecheck/TcArrows.lhs b/ghc/compiler/typecheck/TcArrows.lhs
index 026c006586..b31c03a4ab 100644
--- a/ghc/compiler/typecheck/TcArrows.lhs
+++ b/ghc/compiler/typecheck/TcArrows.lhs
@@ -133,6 +133,18 @@ tcCmd env cmd@(HsArrApp fun arg _ ho_app lr src_loc) (cmd_stk, res_ty)
HsHigherOrderApp -> tc
HsFirstOrderApp -> popArrowBinders tc
+-------------------------------------------
+-- Command application
+
+tcCmd env cmd@(HsApp fun arg) (cmd_stk, res_ty)
+ = addErrCtxt (cmdCtxt cmd) $
+ do { arg_ty <- newTyVarTy openTypeKind
+
+ ; fun' <- tcCmd env fun (arg_ty:cmd_stk, res_ty)
+
+ ; arg' <- tcCheckRho arg arg_ty
+
+ ; return (HsApp fun' arg') }
-------------------------------------------
-- Lambda