summaryrefslogtreecommitdiff
path: root/src/LambdaCube/Compiler/Core.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/LambdaCube/Compiler/Core.hs')
-rw-r--r--src/LambdaCube/Compiler/Core.hs10
1 files changed, 5 insertions, 5 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
149data Neutral 149data 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
304pattern ReducedN y <- Fun f _ (RHS y) 304pattern ReducedN y <- Fun f _ (RHS y)
305pattern Reduced y <- Neut (ReducedN y) 305pattern Reduced y <- Neut (ReducedN y)
306 306
307hnf (Reduced y) = hnf y 307hnf (Reduced y) = y
308hnf a = a 308hnf a = a
309 309
310outputType = tTyCon0 FOutput $ error "cs 9" 310outputType = 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
386instance Rearrange Exp where 386instance 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