diff options
| author | krasimir <krasimir@chalmers.se> | 2011-01-08 20:55:58 +0000 |
|---|---|---|
| committer | krasimir <krasimir@chalmers.se> | 2011-01-08 20:55:58 +0000 |
| commit | 5941995c5994a5bcdfc79ae46ed654581c2ca469 (patch) | |
| tree | e31869bd8ef87f21b9534077e192c8c8c5abda13 /src/runtime/haskell | |
| parent | f7a740d1bd0dfa437e986de06716002eab913f8f (diff) | |
fix the computation of abstract expressions in the presence of implicit arguments
Diffstat (limited to 'src/runtime/haskell')
| -rw-r--r-- | src/runtime/haskell/PGF/Expr.hs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/runtime/haskell/PGF/Expr.hs b/src/runtime/haskell/PGF/Expr.hs index 71e35be5e..db6e7cfd3 100644 --- a/src/runtime/haskell/PGF/Expr.hs +++ b/src/runtime/haskell/PGF/Expr.hs @@ -354,7 +354,9 @@ apply sig env (EFun f) vs = case Map.lookup f (fst sig) of Nothing -> VApp f vs
Nothing -> error ("unknown function "++showCId f)
apply sig env (EApp e1 e2) vs = apply sig env e1 (eval sig env e2 : vs)
-apply sig env (EAbs _ x e) (v:vs) = apply sig (v:env) e vs
+apply sig env (EAbs b x e) (v:vs) = case (b,v) of
+ (Implicit,VImplArg v) -> apply sig (v:env) e vs
+ (Explicit, v) -> apply sig (v:env) e vs
apply sig env (EMeta i) vs = case snd sig i of
Just e -> apply sig env e vs
Nothing -> VMeta i env vs
@@ -369,7 +371,9 @@ applyValue sig (VMeta i env vs0) vs = VMeta i env (vs0++vs) applyValue sig (VGen i vs0) vs = VGen i (vs0++vs)
applyValue sig (VSusp i env vs0 k) vs = VSusp i env vs0 (\v -> applyValue sig (k v) vs)
applyValue sig (VConst f vs0) vs = VConst f (vs0++vs)
-applyValue sig (VClosure env (EAbs b x e)) (v:vs) = apply sig (v:env) e vs
+applyValue sig (VClosure env (EAbs b x e)) (v:vs) = case (b,v) of
+ (Implicit,VImplArg v) -> apply sig (v:env) e vs
+ (Explicit, v) -> apply sig (v:env) e vs
applyValue sig (VImplArg _) vs = error "implicit argument in function position"
-----------------------------------------------------
|
