diff options
author | Péter Diviánszky <divipp@gmail.com> | 2016-04-28 02:01:29 +0200 |
---|---|---|
committer | Péter Diviánszky <divipp@gmail.com> | 2016-04-28 02:01:29 +0200 |
commit | 7e9105793bd0d5ff7197a5860ac5339dea677e0e (patch) | |
tree | fa003b495b78a8b5cb5e6505c72a32bc6e80e1b3 /src/LambdaCube/Compiler/Infer.hs | |
parent | a23ba9fced413f1b63640ba9bd81686a7eb59ee1 (diff) |
switch to ansi-wl-pprint
Diffstat (limited to 'src/LambdaCube/Compiler/Infer.hs')
-rw-r--r-- | src/LambdaCube/Compiler/Infer.hs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/LambdaCube/Compiler/Infer.hs b/src/LambdaCube/Compiler/Infer.hs index 81deaaa0..492e9a69 100644 --- a/src/LambdaCube/Compiler/Infer.hs +++ b/src/LambdaCube/Compiler/Infer.hs | |||
@@ -1188,10 +1188,10 @@ recheck' msg' e (x, xt) = (recheck_ "main" (checkEnv e) (x, xt), xt) | |||
1188 | checkApps s acc zt f _ t [] | 1188 | checkApps s acc zt f _ t [] |
1189 | | t == zt = f $ reverse acc | 1189 | | t == zt = f $ reverse acc |
1190 | | otherwise = | 1190 | | otherwise = |
1191 | error_ $ "checkApps' " ++ s ++ " " ++ msg ++ "\n" ++ showEnvExp te{-todo-} (t, TType) ++ "\n\n" ++ showEnvExp te (zt, TType) | 1191 | error $ "checkApps' " ++ s ++ " " ++ msg ++ "\n" ++ showEnvExp te{-todo-} (t, TType) ++ "\n\n" ++ showEnvExp te (zt, TType) |
1192 | checkApps s acc zt f te t@(unfixlabel -> Pi h x y) (b_: xs) = checkApps (s++"+") (b: acc) zt f te (appTy t b) xs where b = recheck_ "checkApps" te (b_, x) | 1192 | checkApps s acc zt f te t@(unfixlabel -> Pi h x y) (b_: xs) = checkApps (s++"+") (b: acc) zt f te (appTy t b) xs where b = recheck_ "checkApps" te (b_, x) |
1193 | checkApps s acc zt f te t _ = | 1193 | checkApps s acc zt f te t _ = |
1194 | error_ $ "checkApps " ++ s ++ " " ++ msg ++ "\n" ++ showEnvExp te{-todo-} (t, TType) ++ "\n\n" ++ showEnvExp e (x, xt) | 1194 | error $ "checkApps " ++ s ++ " " ++ msg ++ "\n" ++ showEnvExp te{-todo-} (t, TType) ++ "\n\n" ++ showEnvExp e (x, xt) |
1195 | 1195 | ||
1196 | -- Ambiguous: (Int ~ F a) => Int | 1196 | -- Ambiguous: (Int ~ F a) => Int |
1197 | -- Not ambiguous: (Show a, a ~ F b) => b | 1197 | -- Not ambiguous: (Show a, a ~ F b) => b |
@@ -1272,8 +1272,8 @@ instance NFData Info | |||
1272 | instance Show Info where | 1272 | instance Show Info where |
1273 | show = \case | 1273 | show = \case |
1274 | Info r s -> ppShow r ++ " " ++ s | 1274 | Info r s -> ppShow r ++ " " ++ s |
1275 | IType a b -> a ++ " :: " ++ correctEscs b | 1275 | IType a b -> a ++ " :: " ++ b |
1276 | ITrace i s -> i ++ ": " ++ correctEscs s | 1276 | ITrace i s -> i ++ ": " ++ s |
1277 | IError e -> "!" ++ show e | 1277 | IError e -> "!" ++ show e |
1278 | ParseWarning w -> show w | 1278 | ParseWarning w -> show w |
1279 | 1279 | ||
@@ -1392,7 +1392,7 @@ mkELet n x xt = {-(if null vs then id else trace_ $ "mkELet " ++ show (length vs | |||
1392 | term = pmLabel fn vs 0 [] $ getFix x 0 | 1392 | term = pmLabel fn vs 0 [] $ getFix x 0 |
1393 | 1393 | ||
1394 | getFix (Lam z) i = Lam $ getFix z (i+1) | 1394 | getFix (Lam z) i = Lam $ getFix z (i+1) |
1395 | getFix (TFun FprimFix _ [t, Lam f]) i = (if null vs then id else trace_ "!local rec") $ subst 0 (foldl app_ term (downTo 0 i)) f | 1395 | getFix (TFun FprimFix _ [t, Lam f]) i = subst 0 (foldl app_ term (downTo 0 i)) f |
1396 | getFix x _ = x | 1396 | getFix x _ = x |
1397 | 1397 | ||
1398 | 1398 | ||
@@ -1456,7 +1456,7 @@ instance PShow (CEnv Exp) where | |||
1456 | pShowPrec _ = showDoc_ . mkDoc False False | 1456 | pShowPrec _ = showDoc_ . mkDoc False False |
1457 | 1457 | ||
1458 | instance PShow Env where | 1458 | instance PShow Env where |
1459 | pShowPrec _ e = showDoc_ $ envDoc e $ shAtom $ underlined "<<HERE>>" | 1459 | pShowPrec _ e = showDoc_ $ envDoc e $ epar $ shAtom "<<HERE>>" |
1460 | 1460 | ||
1461 | showEnvExp :: Env -> ExpType -> String | 1461 | showEnvExp :: Env -> ExpType -> String |
1462 | showEnvExp e c = showDoc $ envDoc e $ epar $ mkDoc False False c | 1462 | showEnvExp e c = showDoc $ envDoc e $ epar $ mkDoc False False c |