diff options
author | Péter Diviánszky <divipp@gmail.com> | 2016-02-04 04:44:57 +0100 |
---|---|---|
committer | Péter Diviánszky <divipp@gmail.com> | 2016-02-04 04:44:57 +0100 |
commit | fd94a063f2b90f4ab3917e9aa2b7fc26105706c7 (patch) | |
tree | 832cf6e80366d9e010bc74f69b1ab84e56d7a960 | |
parent | 8f57edc8309fa8a25007224f7acb1a22d636911a (diff) |
bugfix
-rw-r--r-- | src/LambdaCube/Compiler/Infer.hs | 7 | ||||
-rw-r--r-- | src/LambdaCube/Compiler/Parser.hs | 58 | ||||
-rw-r--r-- | testdata/Prelude.out | 15 | ||||
-rw-r--r-- | testdata/language-features/basic-list/listcomp05.out | 3 | ||||
-rw-r--r-- | testdata/language-features/basic-list/listcomp06.out | 6 | ||||
-rw-r--r-- | testdata/language-features/basic-list/listcomp07.out | 18 | ||||
-rw-r--r-- | testdata/language-features/recursion/mutualConst.lc | 11 | ||||
-rw-r--r-- | testdata/language-features/recursion/mutualConst.out | 1 |
8 files changed, 71 insertions, 48 deletions
diff --git a/src/LambdaCube/Compiler/Infer.hs b/src/LambdaCube/Compiler/Infer.hs index b6216f74..25b37526 100644 --- a/src/LambdaCube/Compiler/Infer.hs +++ b/src/LambdaCube/Compiler/Infer.hs | |||
@@ -252,7 +252,7 @@ pmLabel :: FunName -> Int -> [Exp] -> Exp -> Exp | |||
252 | pmLabel _ _ _ (unlabel'' -> LabelEnd y) = y | 252 | pmLabel _ _ _ (unlabel'' -> LabelEnd y) = y |
253 | pmLabel f i xs y@Neut{} = PMLabel f i xs y | 253 | pmLabel f i xs y@Neut{} = PMLabel f i xs y |
254 | pmLabel f i xs y@Lam{} = PMLabel f i xs y | 254 | pmLabel f i xs y@Lam{} = PMLabel f i xs y |
255 | --pmLabel f i xs y = trace_ (ppShow y) $ PMLabel f i xs y | 255 | pmLabel f i xs y = error $ "pmLabel: " ++ show y |
256 | 256 | ||
257 | pattern UL a <- (unlabel -> a) where UL = unlabel | 257 | pattern UL a <- (unlabel -> a) where UL = unlabel |
258 | 258 | ||
@@ -1443,10 +1443,11 @@ trLight exs = traceLevel exs >= 1 | |||
1443 | 1443 | ||
1444 | inference_ :: PolyEnv -> Module -> ErrorT (WriterT Infos Identity) PolyEnv | 1444 | inference_ :: PolyEnv -> Module -> ErrorT (WriterT Infos Identity) PolyEnv |
1445 | inference_ (PolyEnv pe is) m = ff $ runWriter $ runExceptT $ mdo | 1445 | inference_ (PolyEnv pe is) m = ff $ runWriter $ runExceptT $ mdo |
1446 | let (x, dns) = definitions m $ mkDesugarInfo defs `joinDesugarInfo` extractDesugarInfo pe | 1446 | let (x, dns) = definitions m ds |
1447 | ds = mkDesugarInfo defs `joinDesugarInfo` extractDesugarInfo pe | ||
1447 | defs <- either (throwError . ErrorMsg) return x | 1448 | defs <- either (throwError . ErrorMsg) return x |
1448 | mapM_ (maybe (return ()) (throwErrorTCM . text)) dns | 1449 | mapM_ (maybe (return ()) (throwErrorTCM . text)) dns |
1449 | mapExceptT (fmap $ ErrorMsg +++ snd) . flip runStateT (initEnv <> pe) . flip runReaderT (extensions m, sourceCode m) . mapM_ (handleStmt defs) $ sortDefs defs | 1450 | mapExceptT (fmap $ ErrorMsg +++ snd) . flip runStateT (initEnv <> pe) . flip runReaderT (extensions m, sourceCode m) . mapM_ (handleStmt defs) $ sortDefs ds defs |
1450 | where | 1451 | where |
1451 | ff (Left e, is) = throwError e | 1452 | ff (Left e, is) = throwError e |
1452 | ff (Right ge, is) = do | 1453 | ff (Right ge, is) = do |
diff --git a/src/LambdaCube/Compiler/Parser.hs b/src/LambdaCube/Compiler/Parser.hs index 3cce82ed..c8b78b0e 100644 --- a/src/LambdaCube/Compiler/Parser.hs +++ b/src/LambdaCube/Compiler/Parser.hs | |||
@@ -469,7 +469,7 @@ parseTerm prec = withRange setSI $ case prec of | |||
469 | ]) | 469 | ]) |
470 | `SAppV` exp | 470 | `SAppV` exp |
471 | 471 | ||
472 | letdecl = mkLets False <$ reserved "let" <*> dsInfo <*> valueDef | 472 | letdecl = mkLets False <$ reserved "let" <*> dsInfo <*> (compileFunAlts' id =<< valueDef) |
473 | 473 | ||
474 | boolExpression = (\pred e -> SBuiltin "primIfThenElse" `SAppV` pred `SAppV` e `SAppV` SBuiltin "Nil") <$> parseTerm PrecLam | 474 | boolExpression = (\pred e -> SBuiltin "primIfThenElse" `SAppV` pred `SAppV` e `SAppV` SBuiltin "Nil") <$> parseTerm PrecLam |
475 | 475 | ||
@@ -674,12 +674,12 @@ compileGuardTrees False ulend lend ge alts = compileGuardTree ulend lend ge $ Al | |||
674 | compileGuardTrees True ulend lend ge alts = foldr1 (SAppV2 $ SBuiltin "parEval" `SAppV` Wildcard SType) $ compileGuardTree ulend lend ge <$> alts | 674 | compileGuardTrees True ulend lend ge alts = foldr1 (SAppV2 $ SBuiltin "parEval" `SAppV` Wildcard SType) $ compileGuardTree ulend lend ge <$> alts |
675 | 675 | ||
676 | compileGuardTree :: (SExp -> SExp) -> (SExp -> SExp) -> DesugarInfo -> GuardTree -> SExp | 676 | compileGuardTree :: (SExp -> SExp) -> (SExp -> SExp) -> DesugarInfo -> GuardTree -> SExp |
677 | compileGuardTree unode node adts t = (\x -> traceD (" ! :" ++ ppShow x) x) $ guardTreeToCases t | 677 | compileGuardTree ulend lend adts t = (\x -> traceD (" ! :" ++ ppShow x) x) $ guardTreeToCases t |
678 | where | 678 | where |
679 | guardTreeToCases :: GuardTree -> SExp | 679 | guardTreeToCases :: GuardTree -> SExp |
680 | guardTreeToCases t = case alts t of | 680 | guardTreeToCases t = case alts t of |
681 | [] -> unode $ SBuiltin "undefined" | 681 | [] -> ulend $ SBuiltin "undefined" |
682 | GuardLeaf e: _ -> node e | 682 | GuardLeaf e: _ -> lend e |
683 | ts@(GuardNode f s _ _: _) -> case Map.lookup s (snd adts) of | 683 | ts@(GuardNode f s _ _: _) -> case Map.lookup s (snd adts) of |
684 | Nothing -> error $ "Constructor is not defined: " ++ s | 684 | Nothing -> error $ "Constructor is not defined: " ++ s |
685 | Just (Left ((t, inum), cns)) -> | 685 | Just (Left ((t, inum), cns)) -> |
@@ -852,16 +852,20 @@ valueDef :: P [Stmt] | |||
852 | valueDef = do | 852 | valueDef = do |
853 | (dns, p) <- try "pattern" $ longPattern <* reservedOp "=" | 853 | (dns, p) <- try "pattern" $ longPattern <* reservedOp "=" |
854 | checkPattern dns | 854 | checkPattern dns |
855 | let n = mangleNames dns | ||
856 | e <- localIndentation Gt $ parseETerm PrecLam | 855 | e <- localIndentation Gt $ parseETerm PrecLam |
857 | ds <- dsInfo | 856 | ds <- dsInfo |
858 | -- todo: more sharing | 857 | return $ desugarValueDef ds p e |
859 | return $ Let n Nothing Nothing [] e | 858 | |
860 | : [ Let x Nothing Nothing [] $ compileCase ds e [(p, Right $ SVar x i)] | 859 | desugarValueDef ds p e |
861 | | (i, x) <- zip [0..] dns | 860 | = FunAlt n [] (Right e) |
862 | ] | 861 | : [ FunAlt x [] $ Right $ compileCase ds (SGlobal n) [(p, Right $ SVar x i)] |
862 | | (i, x) <- zip [0..] dns | ||
863 | ] | ||
863 | where | 864 | where |
864 | mangleNames xs = (foldMap fst xs, "_" ++ intercalate "_" (map snd xs)) | 865 | dns = getPVars p |
866 | n = mangleNames dns | ||
867 | |||
868 | mangleNames xs = (foldMap fst xs, "_" ++ intercalate "_" (map snd xs)) | ||
865 | 869 | ||
866 | parseSomeGuards f = do | 870 | parseSomeGuards f = do |
867 | pos <- sourceColumn <$> getPosition <* reservedOp "|" | 871 | pos <- sourceColumn <$> getPosition <* reservedOp "|" |
@@ -877,7 +881,7 @@ parseSomeGuards f = do | |||
877 | <*> option [] (parseSomeGuards (== pos)) | 881 | <*> option [] (parseSomeGuards (== pos)) |
878 | 882 | ||
879 | mkLets :: Bool -> DesugarInfo -> [Stmt]{-where block-} -> SExp{-main expression-} -> SExp{-big let with lambdas; replaces global names with de bruijn indices-} | 883 | mkLets :: Bool -> DesugarInfo -> [Stmt]{-where block-} -> SExp{-main expression-} -> SExp{-big let with lambdas; replaces global names with de bruijn indices-} |
880 | mkLets a b = mkLets' a b . sortDefs where | 884 | mkLets a ds = mkLets' a ds . sortDefs ds where |
881 | mkLets' _ _ [] e = e | 885 | mkLets' _ _ [] e = e |
882 | mkLets' False ge (Let n _ mt ar x: ds) e | not $ usedS n x | 886 | mkLets' False ge (Let n _ mt ar x: ds) e | not $ usedS n x |
883 | = SLet (False, n, SData Nothing, ar) (maybe id (flip SAnn . addForalls {-todo-}[] []) mt x) (substSG0 n $ mkLets' False ge ds e) | 887 | = SLet (False, n, SData Nothing, ar) (maybe id (flip SAnn . addForalls {-todo-}[] []) mt x) (substSG0 n $ mkLets' False ge ds e) |
@@ -904,7 +908,7 @@ defined defs = ("'Type":) $ flip foldMap defs $ \case | |||
904 | 908 | ||
905 | -------------------------------------------------------------------------------- declaration desugaring | 909 | -------------------------------------------------------------------------------- declaration desugaring |
906 | 910 | ||
907 | sortDefs xs = topSort mempty mempty mempty nodes | 911 | sortDefs ds xs = concatMap (desugarMutual ds) $ topSort mempty mempty mempty mempty nodes |
908 | where | 912 | where |
909 | nodes = zip (zip [0..] xs) $ map (def &&& need) xs | 913 | nodes = zip (zip [0..] xs) $ map (def &&& need) xs |
910 | need = \case | 914 | need = \case |
@@ -916,11 +920,29 @@ sortDefs xs = topSort mempty mempty mempty nodes | |||
916 | Let n _ _ _ _ -> Set.singleton n | 920 | Let n _ _ _ _ -> Set.singleton n |
917 | Data n _ _ _ cs -> Set.singleton n <> Set.fromList (map fst cs) | 921 | Data n _ _ _ cs -> Set.singleton n <> Set.fromList (map fst cs) |
918 | freeS' = Set.fromList . freeS | 922 | freeS' = Set.fromList . freeS |
919 | topSort _ _ _ [] = [] | 923 | topSort acc@(_:_) out defs vs xs | Set.null vs = reverse acc: topSort mempty out defs vs xs |
920 | topSort out defs vs (x@((i, v), (d, u)): ns) | 924 | topSort [] _ _ _ [] = [] |
921 | | i `elem` out = topSort out defs vs ns | 925 | topSort acc out defs vs (x@((i, v), (d, u)): ns) |
922 | | i `elem` vs || all (`elem` defs) u = v: topSort (Set.insert i out) (d <> defs) (Set.delete i vs) ns | 926 | | i `elem` out = topSort acc out defs vs ns |
923 | | otherwise = topSort out defs (Set.insert i vs) $ [x | x@(_, (d, _)) <- nodes, not $ Set.null $ d `Set.intersection` u] ++ x: ns | 927 | | i `elem` vs || all (`elem` defs) u = topSort (v: acc) (Set.insert i out) (d <> defs) (Set.delete i vs) ns |
928 | | otherwise = topSort acc out defs (Set.insert i vs) $ [x | x@(_, (d, _)) <- nodes, not $ Set.null $ d `Set.intersection` u] ++ x: ns | ||
929 | |||
930 | desugarMutual _ [x] = [x] | ||
931 | desugarMutual ds xs = xs | ||
932 | {- | ||
933 | = FunAlt n [] (Right e) | ||
934 | : [ FunAlt x [] $ Right $ compileCase ds (SGlobal n) [(p, Right $ SVar x i)] | ||
935 | | (i, x) <- zip [0..] dns | ||
936 | ] | ||
937 | where | ||
938 | dns = getPVars p | ||
939 | n = mangleNames dns | ||
940 | (ps, es) = unzip [(n, e) | Let n ~Nothing ~Nothing [] e <- xs] | ||
941 | tup = "Tuple" ++ show (length xs) | ||
942 | e = dbf' ps $ foldl SAppV (SBuiltin tup) es | ||
943 | p = PCon (mempty, tup) $ map (ParPat . pure . PVar) ps | ||
944 | -} | ||
945 | |||
924 | 946 | ||
925 | compileFunAlts' lend ds = fmap concat . sequence $ map (compileFunAlts False lend lend ds) $ groupBy h ds where | 947 | compileFunAlts' lend ds = fmap concat . sequence $ map (compileFunAlts False lend lend ds) $ groupBy h ds where |
926 | h (FunAlt n _ _) (FunAlt m _ _) = m == n | 948 | h (FunAlt n _ _) (FunAlt m _ _) = m == n |
diff --git a/testdata/Prelude.out b/testdata/Prelude.out index 02ba7641..ca6fc982 100644 --- a/testdata/Prelude.out +++ b/testdata/Prelude.out | |||
@@ -84,12 +84,11 @@ testdata/Prelude.lc 37:26-37:30 List V6 | |||
84 | testdata/Prelude.lc 37:27-37:28 {a} -> a -> List a -> List a | 84 | testdata/Prelude.lc 37:27-37:28 {a} -> a -> List a -> List a |
85 | testdata/Prelude.lc 37:28-37:30 List V3 | 85 | testdata/Prelude.lc 37:28-37:30 List V3 |
86 | testdata/Prelude.lc 38:10-38:12 V2 -> V2->V2 | V2->V2 | V4 | 86 | testdata/Prelude.lc 38:10-38:12 V2 -> V2->V2 | V2->V2 | V4 |
87 | testdata/Prelude.lc 38:10-38:15 V3 | 87 | testdata/Prelude.lc 38:10-38:15 Tuple2 (List V4) (List V3) | Tuple2 (List V5) (List V4) | V3 |
88 | testdata/Prelude.lc 38:10-38:27 List V1 | List V3 | ||
89 | testdata/Prelude.lc 38:13-38:15 V2 -> V2->V2 | V2->V2 | V3 | 88 | testdata/Prelude.lc 38:13-38:15 V2 -> V2->V2 | V2->V2 | V3 |
90 | testdata/Prelude.lc 38:19-38:24 {a} -> {b} -> List (Tuple2 a b) -> Tuple2 (List a) (List b) | 89 | testdata/Prelude.lc 38:19-38:24 {a} -> {b} -> List (Tuple2 a b) -> Tuple2 (List a) (List b) |
91 | testdata/Prelude.lc 38:19-38:27 Tuple2 (List V1) (List V0) | Tuple2 (List V4) (List V3) | Tuple2 (List V5) (List V4) | 90 | testdata/Prelude.lc 38:19-38:27 Tuple2 (List V1) (List V0) |
92 | testdata/Prelude.lc 38:25-38:27 List (Tuple2 V6 V5) | List (Tuple2 V7 V6) | List V11 | 91 | testdata/Prelude.lc 38:25-38:27 List V11 |
93 | testdata/Prelude.lc 40:1-40:7 {a} -> a->Bool -> List a -> List a | 92 | testdata/Prelude.lc 40:1-40:7 {a} -> a->Bool -> List a -> List a |
94 | testdata/Prelude.lc 40:21-40:23 {a} -> List a | 93 | testdata/Prelude.lc 40:21-40:23 {a} -> List a |
95 | testdata/Prelude.lc 40:21-43:49 List V0 -> List V1 | V0->V1 | 94 | testdata/Prelude.lc 40:21-43:49 List V0 -> List V1 | V0->V1 |
@@ -209,12 +208,10 @@ testdata/Prelude.lc 71:19-71:20 {a} -> a -> List a -> List a | |||
209 | testdata/Prelude.lc 71:21-71:23 V3 | 208 | testdata/Prelude.lc 71:21-71:23 V3 |
210 | testdata/Prelude.lc 71:25-71:27 V3 | 209 | testdata/Prelude.lc 71:25-71:27 V3 |
211 | testdata/Prelude.lc 71:37-71:39 V2 -> V2->V2 | V2->V2 | V4 | 210 | testdata/Prelude.lc 71:37-71:39 V2 -> V2->V2 | V2->V2 | V4 |
212 | testdata/Prelude.lc 71:37-71:43 V3 | 211 | testdata/Prelude.lc 71:37-71:43 Tuple2 V4 V3 | V3 |
213 | testdata/Prelude.lc 71:37-71:55 V0 | V2 | ||
214 | testdata/Prelude.lc 71:41-71:43 V2 -> V2->V2 | V2->V2 | V3 | 212 | testdata/Prelude.lc 71:41-71:43 V2 -> V2->V2 | V2->V2 | V3 |
215 | testdata/Prelude.lc 71:47-71:52 List V10 -> Tuple2 V5 V4 | List V8 -> V4 | V8 | 213 | testdata/Prelude.lc 71:47-71:52 V8 |
216 | testdata/Prelude.lc 71:47-71:55 Tuple2 V1 V0 | Tuple2 V2 V1 | 214 | testdata/Prelude.lc 71:53-71:55 List V7 |
217 | testdata/Prelude.lc 71:53-71:55 List V7 | List V8 | ||
218 | testdata/Prelude.lc 73:1-73:8 {a} -> (a -> a->Ordering) -> List a -> List a -> List a | 215 | testdata/Prelude.lc 73:1-73:8 {a} -> (a -> a->Ordering) -> List a -> List a -> List a |
219 | testdata/Prelude.lc 73:12-73:16 List V0 | 216 | testdata/Prelude.lc 73:12-73:16 List V0 |
220 | testdata/Prelude.lc 73:12-77:21 List V0 | V0->V1 | 217 | testdata/Prelude.lc 73:12-77:21 List V0 | V0->V1 |
diff --git a/testdata/language-features/basic-list/listcomp05.out b/testdata/language-features/basic-list/listcomp05.out index 55d65bc1..e5314964 100644 --- a/testdata/language-features/basic-list/listcomp05.out +++ b/testdata/language-features/basic-list/listcomp05.out | |||
@@ -7,6 +7,5 @@ testdata/language-features/basic-list/listcomp05.lc 1:10-1:38 V1 -> List V1 | |||
7 | testdata/language-features/basic-list/listcomp05.lc 1:19-1:26 List Tuple0 | 7 | testdata/language-features/basic-list/listcomp05.lc 1:19-1:26 List Tuple0 |
8 | testdata/language-features/basic-list/listcomp05.lc 1:20-1:22 Tuple0 | 8 | testdata/language-features/basic-list/listcomp05.lc 1:20-1:22 Tuple0 |
9 | testdata/language-features/basic-list/listcomp05.lc 1:23-1:25 List Tuple0 | Tuple0 | 9 | testdata/language-features/basic-list/listcomp05.lc 1:23-1:25 List Tuple0 | Tuple0 |
10 | testdata/language-features/basic-list/listcomp05.lc 1:32-1:33 V1 | 10 | testdata/language-features/basic-list/listcomp05.lc 1:32-1:33 Tuple0 | V1 |
11 | testdata/language-features/basic-list/listcomp05.lc 1:32-1:38 Tuple0 | ||
12 | testdata/language-features/basic-list/listcomp05.lc 1:36-1:38 Tuple0 | 11 | testdata/language-features/basic-list/listcomp05.lc 1:36-1:38 Tuple0 |
diff --git a/testdata/language-features/basic-list/listcomp06.out b/testdata/language-features/basic-list/listcomp06.out index cfc20330..09e4b2bc 100644 --- a/testdata/language-features/basic-list/listcomp06.out +++ b/testdata/language-features/basic-list/listcomp06.out | |||
@@ -7,8 +7,7 @@ testdata/language-features/basic-list/listcomp06.lc 1:11-1:45 List Tuple0 -> Li | |||
7 | testdata/language-features/basic-list/listcomp06.lc 1:20-1:27 List Tuple0 | 7 | testdata/language-features/basic-list/listcomp06.lc 1:20-1:27 List Tuple0 |
8 | testdata/language-features/basic-list/listcomp06.lc 1:21-1:23 Tuple0 | 8 | testdata/language-features/basic-list/listcomp06.lc 1:21-1:23 Tuple0 |
9 | testdata/language-features/basic-list/listcomp06.lc 1:24-1:26 List Tuple0 | Tuple0 | 9 | testdata/language-features/basic-list/listcomp06.lc 1:24-1:26 List Tuple0 | Tuple0 |
10 | testdata/language-features/basic-list/listcomp06.lc 1:33-1:34 V1 | 10 | testdata/language-features/basic-list/listcomp06.lc 1:33-1:34 Tuple0 | V1 |
11 | testdata/language-features/basic-list/listcomp06.lc 1:33-1:39 Tuple0 | ||
12 | testdata/language-features/basic-list/listcomp06.lc 1:37-1:39 Tuple0 | 11 | testdata/language-features/basic-list/listcomp06.lc 1:37-1:39 Tuple0 |
13 | testdata/language-features/basic-list/listcomp06.lc 1:41-1:45 Bool | 12 | testdata/language-features/basic-list/listcomp06.lc 1:41-1:45 Bool |
14 | testdata/language-features/basic-list/listcomp06.lc 3:1-3:7 List Tuple0 | 13 | testdata/language-features/basic-list/listcomp06.lc 3:1-3:7 List Tuple0 |
@@ -19,6 +18,5 @@ testdata/language-features/basic-list/listcomp06.lc 3:20-3:27 List Tuple0 | |||
19 | testdata/language-features/basic-list/listcomp06.lc 3:21-3:23 Tuple0 | 18 | testdata/language-features/basic-list/listcomp06.lc 3:21-3:23 Tuple0 |
20 | testdata/language-features/basic-list/listcomp06.lc 3:24-3:26 List Tuple0 | Tuple0 | 19 | testdata/language-features/basic-list/listcomp06.lc 3:24-3:26 List Tuple0 | Tuple0 |
21 | testdata/language-features/basic-list/listcomp06.lc 3:29-3:33 Bool | 20 | testdata/language-features/basic-list/listcomp06.lc 3:29-3:33 Bool |
22 | testdata/language-features/basic-list/listcomp06.lc 3:39-3:40 V1 | 21 | testdata/language-features/basic-list/listcomp06.lc 3:39-3:40 Tuple0 | V1 |
23 | testdata/language-features/basic-list/listcomp06.lc 3:39-3:45 Tuple0 | ||
24 | testdata/language-features/basic-list/listcomp06.lc 3:43-3:45 Tuple0 | 22 | testdata/language-features/basic-list/listcomp06.lc 3:43-3:45 Tuple0 |
diff --git a/testdata/language-features/basic-list/listcomp07.out b/testdata/language-features/basic-list/listcomp07.out index ff877833..b292bf10 100644 --- a/testdata/language-features/basic-list/listcomp07.out +++ b/testdata/language-features/basic-list/listcomp07.out | |||
@@ -7,12 +7,10 @@ testdata/language-features/basic-list/listcomp07.lc 1:12-5:21 V1 -> List V1 | |||
7 | testdata/language-features/basic-list/listcomp07.lc 2:17-2:24 List Tuple0 | 7 | testdata/language-features/basic-list/listcomp07.lc 2:17-2:24 List Tuple0 |
8 | testdata/language-features/basic-list/listcomp07.lc 2:18-2:20 Tuple0 | 8 | testdata/language-features/basic-list/listcomp07.lc 2:18-2:20 Tuple0 |
9 | testdata/language-features/basic-list/listcomp07.lc 2:21-2:23 List Tuple0 | Tuple0 | 9 | testdata/language-features/basic-list/listcomp07.lc 2:21-2:23 List Tuple0 | Tuple0 |
10 | testdata/language-features/basic-list/listcomp07.lc 3:16-3:17 V1 | 10 | testdata/language-features/basic-list/listcomp07.lc 3:16-3:17 Tuple0 | V1 |
11 | testdata/language-features/basic-list/listcomp07.lc 3:16-3:22 Tuple0 | ||
12 | testdata/language-features/basic-list/listcomp07.lc 3:20-3:22 Tuple0 | 11 | testdata/language-features/basic-list/listcomp07.lc 3:20-3:22 Tuple0 |
13 | testdata/language-features/basic-list/listcomp07.lc 4:12-4:16 Bool | 12 | testdata/language-features/basic-list/listcomp07.lc 4:12-4:16 Bool |
14 | testdata/language-features/basic-list/listcomp07.lc 5:16-5:17 V1 | 13 | testdata/language-features/basic-list/listcomp07.lc 5:16-5:17 Tuple0 | V1 |
15 | testdata/language-features/basic-list/listcomp07.lc 5:16-5:21 Tuple0 | ||
16 | testdata/language-features/basic-list/listcomp07.lc 5:20-5:21 Tuple0 | 14 | testdata/language-features/basic-list/listcomp07.lc 5:20-5:21 Tuple0 |
17 | testdata/language-features/basic-list/listcomp07.lc 8:1-8:7 List Tuple0 | 15 | testdata/language-features/basic-list/listcomp07.lc 8:1-8:7 List Tuple0 |
18 | testdata/language-features/basic-list/listcomp07.lc 8:10-12:11 List Tuple0 | 16 | testdata/language-features/basic-list/listcomp07.lc 8:10-12:11 List Tuple0 |
@@ -21,12 +19,10 @@ testdata/language-features/basic-list/listcomp07.lc 8:12-11:21 V1 -> List V1 | |||
21 | testdata/language-features/basic-list/listcomp07.lc 8:21-8:28 List Tuple0 | 19 | testdata/language-features/basic-list/listcomp07.lc 8:21-8:28 List Tuple0 |
22 | testdata/language-features/basic-list/listcomp07.lc 8:22-8:24 Tuple0 | 20 | testdata/language-features/basic-list/listcomp07.lc 8:22-8:24 Tuple0 |
23 | testdata/language-features/basic-list/listcomp07.lc 8:25-8:27 List Tuple0 | Tuple0 | 21 | testdata/language-features/basic-list/listcomp07.lc 8:25-8:27 List Tuple0 | Tuple0 |
24 | testdata/language-features/basic-list/listcomp07.lc 9:16-9:17 V1 | 22 | testdata/language-features/basic-list/listcomp07.lc 9:16-9:17 Tuple0 | V1 |
25 | testdata/language-features/basic-list/listcomp07.lc 9:16-9:22 Tuple0 | ||
26 | testdata/language-features/basic-list/listcomp07.lc 9:20-9:22 Tuple0 | 23 | testdata/language-features/basic-list/listcomp07.lc 9:20-9:22 Tuple0 |
27 | testdata/language-features/basic-list/listcomp07.lc 10:12-10:16 Bool | 24 | testdata/language-features/basic-list/listcomp07.lc 10:12-10:16 Bool |
28 | testdata/language-features/basic-list/listcomp07.lc 11:16-11:17 V1 | 25 | testdata/language-features/basic-list/listcomp07.lc 11:16-11:17 Tuple0 | V1 |
29 | testdata/language-features/basic-list/listcomp07.lc 11:16-11:21 Tuple0 | ||
30 | testdata/language-features/basic-list/listcomp07.lc 11:20-11:21 Tuple0 | 26 | testdata/language-features/basic-list/listcomp07.lc 11:20-11:21 Tuple0 |
31 | testdata/language-features/basic-list/listcomp07.lc 14:1-14:7 List Tuple0 | 27 | testdata/language-features/basic-list/listcomp07.lc 14:1-14:7 List Tuple0 |
32 | testdata/language-features/basic-list/listcomp07.lc 14:10-20:3 List Tuple0 | 28 | testdata/language-features/basic-list/listcomp07.lc 14:10-20:3 List Tuple0 |
@@ -35,10 +31,8 @@ testdata/language-features/basic-list/listcomp07.lc 14:12-19:15 V1 -> List V1 | |||
35 | testdata/language-features/basic-list/listcomp07.lc 15:15-15:22 List Tuple0 | 31 | testdata/language-features/basic-list/listcomp07.lc 15:15-15:22 List Tuple0 |
36 | testdata/language-features/basic-list/listcomp07.lc 15:16-15:18 Tuple0 | 32 | testdata/language-features/basic-list/listcomp07.lc 15:16-15:18 Tuple0 |
37 | testdata/language-features/basic-list/listcomp07.lc 15:19-15:21 List Tuple0 | Tuple0 | 33 | testdata/language-features/basic-list/listcomp07.lc 15:19-15:21 List Tuple0 | Tuple0 |
38 | testdata/language-features/basic-list/listcomp07.lc 17:2-17:3 V1 | 34 | testdata/language-features/basic-list/listcomp07.lc 17:2-17:3 Tuple0 | V1 |
39 | testdata/language-features/basic-list/listcomp07.lc 17:2-17:8 Tuple0 | ||
40 | testdata/language-features/basic-list/listcomp07.lc 17:6-17:8 Tuple0 | 35 | testdata/language-features/basic-list/listcomp07.lc 17:6-17:8 Tuple0 |
41 | testdata/language-features/basic-list/listcomp07.lc 18:7-18:11 Bool | 36 | testdata/language-features/basic-list/listcomp07.lc 18:7-18:11 Bool |
42 | testdata/language-features/basic-list/listcomp07.lc 19:10-19:11 V1 | 37 | testdata/language-features/basic-list/listcomp07.lc 19:10-19:11 Tuple0 | V1 |
43 | testdata/language-features/basic-list/listcomp07.lc 19:10-19:15 Tuple0 | ||
44 | testdata/language-features/basic-list/listcomp07.lc 19:14-19:15 Tuple0 | 38 | testdata/language-features/basic-list/listcomp07.lc 19:14-19:15 Tuple0 |
diff --git a/testdata/language-features/recursion/mutualConst.lc b/testdata/language-features/recursion/mutualConst.lc new file mode 100644 index 00000000..92823fd5 --- /dev/null +++ b/testdata/language-features/recursion/mutualConst.lc | |||
@@ -0,0 +1,11 @@ | |||
1 | |||
2 | (a, b) = (True, 'c') | ||
3 | |||
4 | xy = (\x y -> ((1 :: Int): y, 1: x)) (fst xy) (snd xy) | ||
5 | |||
6 | (x, y) = xy | ||
7 | |||
8 | main = a && case x of | ||
9 | 1: 1: 1: _ -> True | ||
10 | |||
11 | |||
diff --git a/testdata/language-features/recursion/mutualConst.out b/testdata/language-features/recursion/mutualConst.out new file mode 100644 index 00000000..65af037c --- /dev/null +++ b/testdata/language-features/recursion/mutualConst.out | |||
@@ -0,0 +1 @@ | |||
[32mTrue[m \ No newline at end of file | |||