diff options
Diffstat (limited to 'src/LambdaCube/Compiler')
-rw-r--r-- | src/LambdaCube/Compiler/Core.hs | 10 | ||||
-rw-r--r-- | src/LambdaCube/Compiler/Infer.hs | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/LambdaCube/Compiler/Core.hs b/src/LambdaCube/Compiler/Core.hs index b193f8fd..0dd1b8c5 100644 --- a/src/LambdaCube/Compiler/Core.hs +++ b/src/LambdaCube/Compiler/Core.hs | |||
@@ -144,7 +144,7 @@ data Exp | |||
144 | | TyCon_ !MaxDB TyConName [Exp] | 144 | | TyCon_ !MaxDB TyConName [Exp] |
145 | | Pi_ !MaxDB Visibility Exp Exp | 145 | | Pi_ !MaxDB Visibility Exp Exp |
146 | | Neut Neutral | 146 | | Neut Neutral |
147 | | RHS Exp | 147 | | RHS Exp{-always in hnf-} |
148 | 148 | ||
149 | data Neutral | 149 | data Neutral |
150 | = Var_ !Int{-De Bruijn index-} | 150 | = Var_ !Int{-De Bruijn index-} |
@@ -304,7 +304,7 @@ mkFun f xs e = mkFun_ (foldMap maxDB_ xs) f xs e | |||
304 | pattern ReducedN y <- Fun f _ (RHS y) | 304 | pattern ReducedN y <- Fun f _ (RHS y) |
305 | pattern Reduced y <- Neut (ReducedN y) | 305 | pattern Reduced y <- Neut (ReducedN y) |
306 | 306 | ||
307 | hnf (Reduced y) = hnf y | 307 | hnf (Reduced y) = y |
308 | hnf a = a | 308 | hnf a = a |
309 | 309 | ||
310 | outputType = tTyCon0 FOutput $ error "cs 9" | 310 | outputType = tTyCon0 FOutput $ error "cs 9" |
@@ -381,7 +381,7 @@ instance Subst Exp Exp where | |||
381 | Con_ md s n as -> Con_ (md <> upDB i dx) s n $ f i <$> as | 381 | Con_ md s n as -> Con_ (md <> upDB i dx) s n $ f i <$> as |
382 | Pi_ md h a b -> Pi_ (md <> upDB i dx) h (f i a) (f (i+1) b) | 382 | Pi_ md h a b -> Pi_ (md <> upDB i dx) h (f i a) (f (i+1) b) |
383 | TyCon_ md s as -> TyCon_ (md <> upDB i dx) s $ f i <$> as | 383 | TyCon_ md s as -> TyCon_ (md <> upDB i dx) s $ f i <$> as |
384 | RHS a -> RHS $ f i a | 384 | RHS a -> RHS $ hnf $ f i a |
385 | 385 | ||
386 | instance Rearrange Exp where | 386 | instance Rearrange Exp where |
387 | rearrange i g = f i where | 387 | rearrange i g = f i where |
@@ -568,8 +568,8 @@ getFunDef t s f = case show s of | |||
568 | "coe" -> Just $ \case (a: b: t: d: _) -> evalCoe a b t d | 568 | "coe" -> Just $ \case (a: b: t: d: _) -> evalCoe a b t d |
569 | "parEval" -> Just $ \case (t: a: b: _) -> parEval t a b | 569 | "parEval" -> Just $ \case (t: a: b: _) -> parEval t a b |
570 | where | 570 | where |
571 | parEval _ (RHS x) _ = RHS x | 571 | parEval _ x@RHS{} _ = x |
572 | parEval _ _ (RHS x) = RHS x | 572 | parEval _ _ x@RHS{} = x |
573 | parEval t a b = ParEval t a b | 573 | parEval t a b = ParEval t a b |
574 | 574 | ||
575 | "unsafeCoerce" -> Just $ \case xs@(_: _: x@NonNeut: _) -> x; xs -> f xs | 575 | "unsafeCoerce" -> Just $ \case xs@(_: _: x@NonNeut: _) -> x; xs -> f xs |
diff --git a/src/LambdaCube/Compiler/Infer.hs b/src/LambdaCube/Compiler/Infer.hs index e5a5c9b9..cd484897 100644 --- a/src/LambdaCube/Compiler/Infer.hs +++ b/src/LambdaCube/Compiler/Infer.hs | |||
@@ -313,7 +313,7 @@ inferN_ tellTrace = infer where | |||
313 | 313 | ||
314 | focus_ :: Env -> ExpType -> IM m ExpType' | 314 | focus_ :: Env -> ExpType -> IM m ExpType' |
315 | focus_ env eet@(ET e et) = tellTrace "focus" (showEnvExp env eet) $ case env of | 315 | focus_ env eet@(ET e et) = tellTrace "focus" (showEnvExp env eet) $ case env of |
316 | ERHS te -> focus_ te (ET (RHS e) et) | 316 | ERHS te -> focus_ te (ET (RHS $ hnf e) et) |
317 | -- CheckSame x te -> focus_ (EBind2_ (debugSI "focus_ CheckSame") BMeta (cstr x e) te) $ up 1 eet | 317 | -- CheckSame x te -> focus_ (EBind2_ (debugSI "focus_ CheckSame") BMeta (cstr x e) te) $ up 1 eet |
318 | CheckAppType si h t te b -- App1 h (CheckType t te) b | 318 | CheckAppType si h t te b -- App1 h (CheckType t te) b |
319 | | Pi h' x (down 0 -> Just y) <- et, h == h' -> case t of | 319 | | Pi h' x (down 0 -> Just y) <- et, h == h' -> case t of |