@@ -51,7 +51,7 @@ data ExecVal = EP NameType Name ExecVal
5151instance Show ExecVal where
5252 show (EP _ n _) = show n
5353 show (EV i) = "!!V" ++ show i ++ "!!"
54− show (EBind n b body) = "EBind " ++ show b ++ " <<fn>> "
54+ show (EBind n b body) = "EBind " ++ show b ++ " <<fn>>"
5555 show (EApp e1 e2) = show e1 ++ " (" ++ show e2 ++ ")"
5656 show (EType _) = "Type"
5757 show EErased = "[__]"
@@ -339,6 +339,7 @@ execApp' env ctxt bnd@(EBind n b body) (arg:args) = do ret <- body arg
339339 execApp' env ctxt f' (as ++ args)
340340execApp' env ctxt (EThunk i) args = do f <- force i
341341 execApp' env ctxt f args
342+execApp' env ctxt app@(EApp _ _) args2 | (f, args1) <- unApplyV app = execApp' env ctxt f (args1 ++ args2)
342343execApp' env ctxt f args = return (mkEApp f args)
343344
344345
@@ -352,9 +353,6 @@ execCase env ctxt ns sc args =
352353 let arity = length ns in
353354 if arity <= length args
354355 then do let amap = zip ns args
355−-- debugThunks
356−-- trace ("Environment: " ++ show env) $ return ()
357−-- trace ("Case exec in " ++ take 1000 (show amap) ++ "\nwith " ++ show sc++"\n") $ return ()
358356 caseRes <- execCase' env ctxt amap sc
359357 case caseRes of
360358 Just res -> Just <$> execApp' (map (\(n, tm) -> (n, tm)) amap ++ env) ctxt res (drop arity args)