diff options
author | Péter Diviánszky <divipp@gmail.com> | 2016-05-10 23:19:47 +0200 |
---|---|---|
committer | Péter Diviánszky <divipp@gmail.com> | 2016-05-10 23:20:23 +0200 |
commit | 95e006bf5afa8d3473e3fe4401f4c9316186a428 (patch) | |
tree | 7635fda3305339173988296051acc5a77dbb746f | |
parent | 6ecef8f577432ffcaee07f09b2a73d4ea5eb5de2 (diff) |
include info in more .out files; fix parsing of as-patterns
32 files changed, 3210 insertions, 60 deletions
diff --git a/src/LambdaCube/Compiler/Lexer.hs b/src/LambdaCube/Compiler/Lexer.hs index c47ba1ce..fe3015a6 100644 --- a/src/LambdaCube/Compiler/Lexer.hs +++ b/src/LambdaCube/Compiler/Lexer.hs | |||
@@ -141,7 +141,16 @@ lexemeWithoutSpace p = do | |||
141 | 141 | ||
142 | -- TODO?: eliminate; when eliminated, the SPos in parser state can be eliminated too | 142 | -- TODO?: eliminate; when eliminated, the SPos in parser state can be eliminated too |
143 | appRange :: Parse r w (SI -> a) -> Parse r w a | 143 | appRange :: Parse r w (SI -> a) -> Parse r w a |
144 | appRange p = (\fi p1 a p2 -> a $ RangeSI $ Range fi p1 p2) <$> asks fileInfo <*> getSPos <*> p <*> get | 144 | appRange p = (\fi p1 a p2 -> a $ RangeSI $ Range fi p1 p2) <$> asks fileInfo <*> getSPos <*> p <*> getLexemeEnd |
145 | |||
146 | getLexemeEnd = get | ||
147 | |||
148 | noSpaceBefore p = try $ do | ||
149 | pos <- getLexemeEnd | ||
150 | x <- p | ||
151 | guard $ case sourceInfo x of | ||
152 | RangeSI (Range _ pos' _) -> pos == pos' | ||
153 | return x | ||
145 | 154 | ||
146 | lexeme_ p = lexemeWithoutSpace p <* whiteSpace | 155 | lexeme_ p = lexemeWithoutSpace p <* whiteSpace |
147 | 156 | ||
@@ -224,9 +233,9 @@ upperLower = lowerCase <|> upperCase_ <|> parens symbols | |||
224 | 233 | ||
225 | ----------------------------------------------------------- operators and identifiers | 234 | ----------------------------------------------------------- operators and identifiers |
226 | 235 | ||
227 | reservedOp name = lexeme $ try $ string name *> notFollowedBy opLetter | 236 | reservedOp name = fst <$> lexeme_ (try $ string name *> notFollowedBy opLetter) |
228 | 237 | ||
229 | reserved name = lexeme $ try $ string name *> notFollowedBy identLetter | 238 | reserved name = fst <$> lexeme_ (try $ string name *> notFollowedBy identLetter) |
230 | 239 | ||
231 | expect msg p i = i >>= \n -> if p n then unexpected (msg ++ " " ++ show n) else return n | 240 | expect msg p i = i >>= \n -> if p n then unexpected (msg ++ " " ++ show n) else return n |
232 | 241 | ||
diff --git a/src/LambdaCube/Compiler/Parser.hs b/src/LambdaCube/Compiler/Parser.hs index 1d5139b8..79975251 100644 --- a/src/LambdaCube/Compiler/Parser.hs +++ b/src/LambdaCube/Compiler/Parser.hs | |||
@@ -172,8 +172,7 @@ parseTermLam = | |||
172 | <|> mkIf <$ reserved "if" <*> setR parseTermLam | 172 | <|> mkIf <$ reserved "if" <*> setR parseTermLam |
173 | <* reserved "then" <*> setR parseTermLam | 173 | <* reserved "then" <*> setR parseTermLam |
174 | <* reserved "else" <*> setR parseTermLam | 174 | <* reserved "else" <*> setR parseTermLam |
175 | <|> do reserved "forall" | 175 | <|> do (fe, ts) <- reserved "forall" *> telescope (Just $ Wildcard SType) |
176 | (fe, ts) <- telescope $ Just $ Wildcard SType | ||
177 | f <- SPi . const Hidden <$ reservedOp "." <|> SPi . const Visible <$ reservedOp "->" | 176 | f <- SPi . const Hidden <$ reservedOp "." <|> SPi . const Visible <$ reservedOp "->" |
178 | t' <- deBruijnify fe <$> setR parseTermLam | 177 | t' <- deBruijnify fe <$> setR parseTermLam |
179 | return $ foldr (uncurry f) t' ts | 178 | return $ foldr (uncurry f) t' ts |
@@ -329,7 +328,7 @@ parsePatApp = | |||
329 | PConSimp <$> addConsInfo upperCase_ <*> many (setR parsePatAt) | 328 | PConSimp <$> addConsInfo upperCase_ <*> many (setR parsePatAt) |
330 | <|> parsePatAt | 329 | <|> parsePatAt |
331 | 330 | ||
332 | parsePatAt = concatParPats <$> sepBy1 (setR parsePatAtom) (reservedOp "@") | 331 | parsePatAt = concatParPats <$> sepBy1 (setR parsePatAtom) (noSpaceBefore $ reservedOp "@") |
333 | where | 332 | where |
334 | concatParPats ps = ParPat $ concat [p | ParPat p <- ps] | 333 | concatParPats ps = ParPat $ concat [p | ParPat p <- ps] |
335 | 334 | ||
@@ -373,7 +372,7 @@ parsePatAtom = | |||
373 | longPattern = setR parsePatAnn <&> (reverse . getPVars &&& id) | 372 | longPattern = setR parsePatAnn <&> (reverse . getPVars &&& id) |
374 | 373 | ||
375 | telescopePat = do | 374 | telescopePat = do |
376 | (a, b) <- fmap (reverse . foldMap (getPVars . snd) &&& id) $ many $ uncurry f <$> hiddenTerm (setR parsePatAtom) (setR parsePatAtom) | 375 | (a, b) <- fmap (reverse . foldMap (getPVars . snd) &&& id) $ many $ uncurry f <$> hiddenTerm (setR parsePatAt) (setR parsePatAt) |
377 | checkPattern a | 376 | checkPattern a |
378 | return (a, b) | 377 | return (a, b) |
379 | where | 378 | where |
@@ -468,8 +467,7 @@ parseRHS :: String -> BodyParser GuardTrees | |||
468 | parseRHS tok = do | 467 | parseRHS tok = do |
469 | mkGuards <$> some (reservedOp "|" *> guard) <*> option [] (reserved "where" *> parseDefs) | 468 | mkGuards <$> some (reservedOp "|" *> guard) <*> option [] (reserved "where" *> parseDefs) |
470 | <|> do | 469 | <|> do |
471 | reservedOp tok | 470 | rhs <- reservedOp tok *> setR parseTermLam |
472 | rhs <- setR parseTermLam | ||
473 | f <- option id $ mkLets <$ reserved "where" <*> parseDefs | 471 | f <- option id $ mkLets <$ reserved "where" <*> parseDefs |
474 | noGuards <$> trackSI (pure $ f rhs) | 472 | noGuards <$> trackSI (pure $ f rhs) |
475 | where | 473 | where |
@@ -493,8 +491,7 @@ funAltDef parseOpName parseName = do | |||
493 | Just opName -> try_ "operator definition" $ do | 491 | Just opName -> try_ "operator definition" $ do |
494 | (e', a1) <- longPattern | 492 | (e', a1) <- longPattern |
495 | n <- opName | 493 | n <- opName |
496 | (e'', a2) <- longPattern | 494 | (e'', a2) <- longPattern <* lookAhead (reservedOp "=" <|> reservedOp "|") |
497 | lookAhead $ reservedOp "=" <|> reservedOp "|" | ||
498 | let fee = e'' <> e' | 495 | let fee = e'' <> e' |
499 | checkPattern fee | 496 | checkPattern fee |
500 | return (n, (fee, (,) (Visible, Wildcard SType) <$> [a1, deBruijnify e' a2])) | 497 | return (n, (fee, (,) (Visible, Wildcard SType) <$> [a1, deBruijnify e' a2])) |
@@ -539,8 +536,7 @@ parseModule = do | |||
539 | whiteSpace | 536 | whiteSpace |
540 | header <- optional $ do | 537 | header <- optional $ do |
541 | modn <- reserved "module" *> moduleName | 538 | modn <- reserved "module" *> moduleName |
542 | exps <- optional (parens $ commaSep parseExport) | 539 | exps <- optional (parens $ commaSep parseExport) <* reserved "where" |
543 | reserved "where" | ||
544 | return (modn, exps) | 540 | return (modn, exps) |
545 | let mkIDef _ n i h _ = (n, f i h) | 541 | let mkIDef _ n i h _ = (n, f i h) |
546 | where | 542 | where |
diff --git a/test/runTests.hs b/test/runTests.hs index b817ed0b..9293381e 100644 --- a/test/runTests.hs +++ b/test/runTests.hs | |||
@@ -125,8 +125,8 @@ isWip = (".wip" `elem`) . takeExtensions' | |||
125 | isReject = (".reject" `elem`) . takeExtensions' | 125 | isReject = (".reject" `elem`) . takeExtensions' |
126 | 126 | ||
127 | -- for the repl | 127 | -- for the repl |
128 | parse srcName includePaths = do | 128 | parse srcName = do |
129 | pplRes <- parseModule includePaths srcName | 129 | pplRes <- parseModule ["testdata"] srcName |
130 | case pplRes of | 130 | case pplRes of |
131 | Left err -> fail $ show err | 131 | Left err -> fail $ show err |
132 | Right ppl -> putStrLn ppl | 132 | Right ppl -> putStrLn ppl |
@@ -229,24 +229,24 @@ doTest Config{..} (i, fn) = do | |||
229 | f ((i, desug), e) | not $ isReject fn = case e of | 229 | f ((i, desug), e) | not $ isReject fn = case e of |
230 | Left (show -> e) -> Left (unlines $ tab "!Failed" e: map show (listTraceInfos i), Failed) | 230 | Left (show -> e) -> Left (unlines $ tab "!Failed" e: map show (listTraceInfos i), Failed) |
231 | Right (fname, ge, Left (pShow -> e)) | 231 | Right (fname, ge, Left (pShow -> e)) |
232 | -> Right ("typechecked module" | 232 | -> Right ("typechecked module", simpleShow $ vcat $ e: showGE fname ge) |
233 | , simpleShow $ vcat $ e | ||
234 | : "------------ desugared source code": intersperse "" (map pShow desug) | ||
235 | ++ "------------ core code": intersperse "" | ||
236 | [ DAnn (text n) (DResetFreshNames $ pShow t) | ||
237 | <$$> DLet "=" (text n) (DResetFreshNames $ mkDoc (True, True) e) | ||
238 | | (n, (e, t, RangeSI (Range fi _ _))) <- Map.toList ge, fileId fi == fileId fname] | ||
239 | ++ listAllInfos' i) | ||
240 | Right (fname, ge, Right (ET e te)) | 233 | Right (fname, ge, Right (ET e te)) |
241 | | te == outputType -> Right ("compiled pipeline", prettyShowUnlines $ compilePipeline OpenGL33 (ET e te)) | 234 | | te == outputType -> Right ("compiled pipeline", prettyShowUnlines $ compilePipeline OpenGL33 (ET e te)) |
242 | | e == trueExp -> Right ("reducted main", de) | 235 | | e == trueExp -> Right ("reducted main", de) |
243 | | te == boolType -> Left (tab "!Failed" $ "main should be True but it is \n" ++ de, Failed) | 236 | | te == boolType -> Left (tab "!Failed" $ "main should be True but it is \n" ++ de, Failed) |
244 | | otherwise -> Right ("reduced main " ++ ppShow te, de) | 237 | | otherwise -> Right ("reduced main :: " ++ ppShow te, de) |
245 | where | 238 | where |
246 | de = simpleShow (mkDoc (True, False) e) | 239 | de = simpleShow $ vcat $ (DAnn "main" $ pShow te) : (DLet "=" "main" $ mkDoc (True, False) e): showGE fname ge |
247 | | otherwise = case e of | 240 | | otherwise = case e of |
248 | Left (pShow -> e) -> Right ("error message", simpleShow $ vcat $ e: listAllInfos i) | 241 | Left (pShow -> e) -> Right ("error message", simpleShow $ vcat $ e: listAllInfos i) |
249 | Right _ -> Left (tab "!Failed" "failed to catch error", Failed) | 242 | Right _ -> Left (tab "!Failed" "failed to catch error", Failed) |
243 | where | ||
244 | showGE fname ge = "------------ desugared source code": intersperse "" (map pShow desug) | ||
245 | ++ "------------ core code": intersperse "" | ||
246 | [ DAnn (text n) (DResetFreshNames $ pShow t) | ||
247 | <$$> DLet "=" (text n) (DResetFreshNames $ mkDoc (True, True) e) | ||
248 | | (n, (e, t, RangeSI (Range fi _ _))) <- Map.toList ge, fileId fi == fileId fname] | ||
249 | ++ listAllInfos' i | ||
250 | 250 | ||
251 | tab msg | 251 | tab msg |
252 | | isWip fn && cfgReject = const msg | 252 | | isWip fn && cfgReject = const msg |
diff --git a/testdata/concatmap01.out b/testdata/concatmap01.out index 4791ed55..907c0397 100644 --- a/testdata/concatmap01.out +++ b/testdata/concatmap01.out | |||
@@ -1 +1,66 @@ | |||
1 | True \ No newline at end of file | 1 | main :: Bool |
2 | main = True | ||
3 | ------------ desugared source code | ||
4 | a :: [Float] | ||
5 | a = _lhs a (_rhs (concatMap (\(a :: _) -> [a]) [1.0])) | ||
6 | |||
7 | main :: Bool | ||
8 | main | ||
9 | = _lhs | ||
10 | main | ||
11 | (_rhs | ||
12 | ((\(a :: _) -> case'List | ||
13 | (\(_ :: _) -> _) | ||
14 | undefined | ||
15 | (\(b :: _) (c :: _) -> case'Bool | ||
16 | (\(_ :: _) -> _) | ||
17 | undefined | ||
18 | (case'List (\(_ :: _) -> _) True (\(_ :: _) (_ :: _) -> undefined) c) | ||
19 | (1.0 == b)) | ||
20 | a) | ||
21 | a)) | ||
22 | ------------ core code | ||
23 | a :: [Float] | ||
24 | a = _rhs [1.0] | ||
25 | |||
26 | main :: Bool | ||
27 | main = _rhs True | ||
28 | ------------ tooltips | ||
29 | testdata/concatmap01.lc 1:6-1:13 | ||
30 | Type | ||
31 | testdata/concatmap01.lc 1:7-1:12 | ||
32 | Type | ||
33 | testdata/concatmap01.lc 2:1-2:2 | ||
34 | [Float] | ||
35 | testdata/concatmap01.lc 2:5-2:14 | ||
36 | forall a b . (a -> [b]) -> [a] -> [b] | ||
37 | testdata/concatmap01.lc 2:5-2:26 | ||
38 | [_a] -> [_a] | ||
39 | testdata/concatmap01.lc 2:5-2:32 | ||
40 | [Float] | ||
41 | testdata/concatmap01.lc 2:22-2:25 | ||
42 | [_b] | ||
43 | testdata/concatmap01.lc 2:23-2:24 | ||
44 | _d | ||
45 | testdata/concatmap01.lc 2:27-2:32 | ||
46 | [Float] | ||
47 | testdata/concatmap01.lc 2:28-2:31 | ||
48 | Float | ||
49 | testdata/concatmap01.lc 4:9-4:13 | ||
50 | Type | ||
51 | testdata/concatmap01.lc 5:1-5:5 | ||
52 | Bool | ||
53 | testdata/concatmap01.lc 5:8-6:23 | ||
54 | Bool | ||
55 | testdata/concatmap01.lc 5:13-5:14 | ||
56 | [Float] | ||
57 | testdata/concatmap01.lc 6:19-6:23 | ||
58 | Bool | Bool | Bool | ||
59 | ------------ warnings | ||
60 | Uncovered pattern(s) at testdata/concatmap01.lc:5:13: | ||
61 | main = case a of | ||
62 | ^ | ||
63 | Missing case(s): | ||
64 | [] | ||
65 | (_ : _) | False <- 1.0 == _b | ||
66 | (_ : _ : _) | True <- 1.0 == _b \ No newline at end of file | ||
diff --git a/testdata/dotdot01.out b/testdata/dotdot01.out index 4791ed55..0ce6f980 100644 --- a/testdata/dotdot01.out +++ b/testdata/dotdot01.out | |||
@@ -1 +1,64 @@ | |||
1 | True \ No newline at end of file | 1 | main :: Bool |
2 | main = True | ||
3 | ------------ desugared source code | ||
4 | main :: Bool | ||
5 | main | ||
6 | = _lhs | ||
7 | main | ||
8 | (_rhs | ||
9 | ((\(a :: _) -> case'List | ||
10 | (\(_ :: _) -> _) | ||
11 | undefined | ||
12 | (\(b :: _) (c :: _) -> case'Bool | ||
13 | (\(_ :: _) -> _) | ||
14 | undefined | ||
15 | (case'List | ||
16 | (\(_ :: _) -> _) | ||
17 | undefined | ||
18 | (\(d :: _) (e :: _) -> case'Bool | ||
19 | (\(_ :: _) -> _) | ||
20 | undefined | ||
21 | (case'List | ||
22 | (\(_ :: _) -> _) | ||
23 | undefined | ||
24 | (\(f :: _) (g :: _) -> case'Bool | ||
25 | (\(_ :: _) -> _) | ||
26 | undefined | ||
27 | (case'List (\(_ :: _) -> _) True (\(_ :: _) (_ :: _) -> undefined) g) | ||
28 | (3.0 == f)) | ||
29 | e) | ||
30 | (2.0 == d)) | ||
31 | c) | ||
32 | (1.0 == b)) | ||
33 | a) | ||
34 | (fromTo 1.0 3.0))) | ||
35 | ------------ core code | ||
36 | main :: Bool | ||
37 | main = _rhs True | ||
38 | ------------ tooltips | ||
39 | testdata/dotdot01.lc 1:9-1:13 | ||
40 | Type | ||
41 | testdata/dotdot01.lc 2:1-2:5 | ||
42 | Bool | ||
43 | testdata/dotdot01.lc 2:8-3:33 | ||
44 | Bool | ||
45 | testdata/dotdot01.lc 2:13-2:23 | ||
46 | [Float] | ||
47 | testdata/dotdot01.lc 2:14-2:17 | ||
48 | Float | ||
49 | testdata/dotdot01.lc 2:19-2:22 | ||
50 | Float | ||
51 | testdata/dotdot01.lc 3:29-3:33 | ||
52 | Bool | Bool | Bool | Bool | Bool | Bool | Bool | ||
53 | ------------ warnings | ||
54 | Uncovered pattern(s) at testdata/dotdot01.lc:2:13: | ||
55 | main = case [1.0..3.0] of | ||
56 | ^^^^^^^^^^ | ||
57 | Missing case(s): | ||
58 | [] | ||
59 | (_ : _) | False <- 1.0 == _b | ||
60 | [_] | True <- 1.0 == _b | ||
61 | (_ : _ : _) | True <- 1.0 == _b, False <- 2.0 == _b | ||
62 | [_, _] | True <- 1.0 == _b, True <- 2.0 == _b | ||
63 | (_ : _ : _ : _) | True <- 1.0 == _b, True <- 2.0 == _b, False <- 3.0 == _b | ||
64 | (_ : _ : _ : _ : _) | True <- 1.0 == _b, True <- 2.0 == _b, True <- 3.0 == _b \ No newline at end of file | ||
diff --git a/testdata/dotdot02.out b/testdata/dotdot02.out index 4791ed55..74a7d6cc 100644 --- a/testdata/dotdot02.out +++ b/testdata/dotdot02.out | |||
@@ -1 +1,38 @@ | |||
1 | True \ No newline at end of file | 1 | main :: Bool |
2 | main = True | ||
3 | ------------ desugared source code | ||
4 | main :: Bool | ||
5 | main | ||
6 | = _lhs | ||
7 | main | ||
8 | (_rhs | ||
9 | ((\(a :: _) -> case'List | ||
10 | (\(_ :: _) -> _) | ||
11 | True | ||
12 | (\(_ :: _) (_ :: _) -> undefined) | ||
13 | a) | ||
14 | (fromTo 3.0 1.0))) | ||
15 | ------------ core code | ||
16 | main :: Bool | ||
17 | main = _rhs True | ||
18 | ------------ tooltips | ||
19 | testdata/dotdot02.lc 1:9-1:13 | ||
20 | Type | ||
21 | testdata/dotdot02.lc 2:1-2:5 | ||
22 | Bool | ||
23 | testdata/dotdot02.lc 2:8-3:20 | ||
24 | Bool | ||
25 | testdata/dotdot02.lc 2:13-2:23 | ||
26 | [Float] | ||
27 | testdata/dotdot02.lc 2:14-2:17 | ||
28 | Float | ||
29 | testdata/dotdot02.lc 2:19-2:22 | ||
30 | Float | ||
31 | testdata/dotdot02.lc 3:16-3:20 | ||
32 | Bool | ||
33 | ------------ warnings | ||
34 | Uncovered pattern(s) at testdata/dotdot02.lc:2:13: | ||
35 | main = case [3.0..1.0] of | ||
36 | ^^^^^^^^^^ | ||
37 | Missing case(s): | ||
38 | (_ : _) \ No newline at end of file | ||
diff --git a/testdata/fromto.out b/testdata/fromto.out index 4791ed55..eee2d5b9 100644 --- a/testdata/fromto.out +++ b/testdata/fromto.out | |||
@@ -1 +1,68 @@ | |||
1 | True \ No newline at end of file | 1 | main :: Bool |
2 | main = True | ||
3 | ------------ desugared source code | ||
4 | main :: Bool | ||
5 | main | ||
6 | = _lhs | ||
7 | main | ||
8 | (_rhs | ||
9 | ((\(a :: _) -> case'List | ||
10 | (\(_ :: _) -> _) | ||
11 | undefined | ||
12 | (\(b :: _) (c :: _) -> case'Bool | ||
13 | (\(_ :: _) -> _) | ||
14 | undefined | ||
15 | (case'List | ||
16 | (\(_ :: _) -> _) | ||
17 | undefined | ||
18 | (\(d :: _) (e :: _) -> case'Bool | ||
19 | (\(_ :: _) -> _) | ||
20 | undefined | ||
21 | (case'List | ||
22 | (\(_ :: _) -> _) | ||
23 | undefined | ||
24 | (\(f :: _) (g :: _) -> case'Bool | ||
25 | (\(_ :: _) -> _) | ||
26 | undefined | ||
27 | (case'List (\(_ :: _) -> _) True (\(_ :: _) (_ :: _) -> undefined) g) | ||
28 | (3.0 == f)) | ||
29 | e) | ||
30 | (2.0 == d)) | ||
31 | c) | ||
32 | (1.0 == b)) | ||
33 | a) | ||
34 | (fromTo 1.0 3.0))) | ||
35 | ------------ core code | ||
36 | main :: Bool | ||
37 | main = _rhs True | ||
38 | ------------ tooltips | ||
39 | testdata/fromto.lc 1:9-1:13 | ||
40 | Type | ||
41 | testdata/fromto.lc 2:1-2:5 | ||
42 | Bool | ||
43 | testdata/fromto.lc 2:8-3:33 | ||
44 | Bool | ||
45 | testdata/fromto.lc 2:14-2:20 | ||
46 | Float -> Float -> [Float] | ||
47 | testdata/fromto.lc 2:14-2:24 | ||
48 | Float -> [Float] | ||
49 | testdata/fromto.lc 2:14-2:28 | ||
50 | [Float] | ||
51 | testdata/fromto.lc 2:21-2:24 | ||
52 | Float | ||
53 | testdata/fromto.lc 2:25-2:28 | ||
54 | Float | ||
55 | testdata/fromto.lc 3:29-3:33 | ||
56 | Bool | Bool | Bool | Bool | Bool | Bool | Bool | ||
57 | ------------ warnings | ||
58 | Uncovered pattern(s) at testdata/fromto.lc:2:13: | ||
59 | main = case (fromTo 1.0 3.0) of | ||
60 | ^^^^^^^^^^^^^^^^ | ||
61 | Missing case(s): | ||
62 | [] | ||
63 | (_ : _) | False <- 1.0 == _b | ||
64 | [_] | True <- 1.0 == _b | ||
65 | (_ : _ : _) | True <- 1.0 == _b, False <- 2.0 == _b | ||
66 | [_, _] | True <- 1.0 == _b, True <- 2.0 == _b | ||
67 | (_ : _ : _ : _) | True <- 1.0 == _b, True <- 2.0 == _b, False <- 3.0 == _b | ||
68 | (_ : _ : _ : _ : _) | True <- 1.0 == _b, True <- 2.0 == _b, True <- 3.0 == _b \ No newline at end of file | ||
diff --git a/testdata/ifThenElse01.out b/testdata/ifThenElse01.out index 4791ed55..c9190f84 100644 --- a/testdata/ifThenElse01.out +++ b/testdata/ifThenElse01.out | |||
@@ -1 +1,27 @@ | |||
1 | True \ No newline at end of file | 1 | main :: Bool |
2 | main = True | ||
3 | ------------ desugared source code | ||
4 | main :: Bool | ||
5 | main = _lhs main (_rhs ((\(a :: _) -> primIfThenElse a a a) True)) | ||
6 | ------------ core code | ||
7 | main :: Bool | ||
8 | main = _rhs True | ||
9 | ------------ tooltips | ||
10 | testdata/ifThenElse01.lc 1:9-1:13 | ||
11 | Type | ||
12 | testdata/ifThenElse01.lc 2:1-2:5 | ||
13 | Bool | ||
14 | testdata/ifThenElse01.lc 2:8-2:39 | ||
15 | Bool | ||
16 | testdata/ifThenElse01.lc 2:15-2:33 | ||
17 | Bool | ||
18 | testdata/ifThenElse01.lc 2:18-2:19 | ||
19 | _c | ||
20 | testdata/ifThenElse01.lc 2:18-2:26 | ||
21 | Bool -> Bool | ||
22 | testdata/ifThenElse01.lc 2:25-2:26 | ||
23 | Bool | ||
24 | testdata/ifThenElse01.lc 2:32-2:33 | ||
25 | Bool | ||
26 | testdata/ifThenElse01.lc 2:35-2:39 | ||
27 | Bool \ No newline at end of file | ||
diff --git a/testdata/instantiate2.out b/testdata/instantiate2.out index 94306cec..bd3f4135 100644 --- a/testdata/instantiate2.out +++ b/testdata/instantiate2.out | |||
@@ -1 +1,53 @@ | |||
1 | (PrimAdd ('VecS 'Float 2) TT (V2 1.0 2.0) (V2 2.3 3.4), 3.0) \ No newline at end of file | 1 | main :: (VecS Float 2, Float) |
2 | main = (PrimAdd ('VecS 'Float 2) TT (V2 1.0 2.0) (V2 2.3 3.4), 3.0) | ||
3 | ------------ desugared source code | ||
4 | main | ||
5 | = _lhs | ||
6 | main | ||
7 | (_rhs let a = _lhs f (_rhs (+)) in (a (V2 1.0 2.0) (V2 2.3 3.4), a 1.0 2.0)) | ||
8 | ------------ core code | ||
9 | main :: (VecS Float 2, Float) | ||
10 | main = _rhs (PrimAdd ('VecS 'Float 2) TT (V2 1.0 2.0) (V2 2.3 3.4), 3.0) | ||
11 | ------------ tooltips | ||
12 | testdata/instantiate2.lc 1:1-1:5 | ||
13 | (VecS Float 2, Float) | ||
14 | testdata/instantiate2.lc 1:16-1:19 | ||
15 | forall a . Num (MatVecScalarElem a) => a -> a -> a | ||
16 | testdata/instantiate2.lc 1:23-1:63 | ||
17 | (VecS Float 2, Float) | ||
18 | testdata/instantiate2.lc 1:24-1:25 | ||
19 | forall a . Num (MatVecScalarElem a) => a -> a -> a | ||
20 | testdata/instantiate2.lc 1:24-1:38 | ||
21 | VecS Float 2 -> VecS Float 2 | ||
22 | testdata/instantiate2.lc 1:24-1:51 | ||
23 | VecS Float 2 | ||
24 | testdata/instantiate2.lc 1:27-1:29 | ||
25 | forall a . a -> a -> VecS a 2 | ||
26 | testdata/instantiate2.lc 1:27-1:33 | ||
27 | Float -> VecS Float 2 | ||
28 | testdata/instantiate2.lc 1:27-1:37 | ||
29 | VecS Float 2 | ||
30 | testdata/instantiate2.lc 1:30-1:33 | ||
31 | Float | ||
32 | testdata/instantiate2.lc 1:34-1:37 | ||
33 | Float | ||
34 | testdata/instantiate2.lc 1:40-1:42 | ||
35 | forall a . a -> a -> VecS a 2 | ||
36 | testdata/instantiate2.lc 1:40-1:46 | ||
37 | Float -> VecS Float 2 | ||
38 | testdata/instantiate2.lc 1:40-1:50 | ||
39 | VecS Float 2 | ||
40 | testdata/instantiate2.lc 1:43-1:46 | ||
41 | Float | ||
42 | testdata/instantiate2.lc 1:47-1:50 | ||
43 | Float | ||
44 | testdata/instantiate2.lc 1:53-1:54 | ||
45 | forall a . Num (MatVecScalarElem a) => a -> a -> a | ||
46 | testdata/instantiate2.lc 1:53-1:58 | ||
47 | Float -> Float | ||
48 | testdata/instantiate2.lc 1:53-1:62 | ||
49 | Float | ((Float)) | ||
50 | testdata/instantiate2.lc 1:55-1:58 | ||
51 | Float | ||
52 | testdata/instantiate2.lc 1:59-1:62 | ||
53 | Float \ No newline at end of file | ||
diff --git a/testdata/it.out b/testdata/it.out index 4791ed55..0c3dce37 100644 --- a/testdata/it.out +++ b/testdata/it.out | |||
@@ -1 +1,101 @@ | |||
1 | True \ No newline at end of file | 1 | main :: Bool |
2 | main = True | ||
3 | ------------ desugared source code | ||
4 | from = _lhs from (_rhs \(a :: _) -> a : from (primAddInt (fromInt 1) a)) | ||
5 | |||
6 | main | ||
7 | = _lhs | ||
8 | main | ||
9 | (_rhs | ||
10 | ((\(a :: _) -> case'List | ||
11 | (\(_ :: _) -> _) | ||
12 | undefined | ||
13 | (\(_ :: _) (b :: _) -> case'List | ||
14 | (\(_ :: _) -> _) | ||
15 | undefined | ||
16 | (\(_ :: _) (c :: _) -> case'List | ||
17 | (\(_ :: _) -> _) | ||
18 | undefined | ||
19 | (\(_ :: _) (d :: _) -> case'List | ||
20 | (\(_ :: _) -> _) | ||
21 | undefined | ||
22 | (\(e :: _) (_ :: _) -> (\(f :: _) -> case'Ordering | ||
23 | (\(_ :: _) -> _) | ||
24 | undefined | ||
25 | True | ||
26 | undefined | ||
27 | f) | ||
28 | (primCompareInt e (fromInt 3))) | ||
29 | d) | ||
30 | c) | ||
31 | b) | ||
32 | a) | ||
33 | (from (fromInt 0)))) | ||
34 | ------------ core code | ||
35 | from :: Int -> [Int] | ||
36 | from = primFix ('Int -> ['Int]) \a -> _rhs \b -> b : a (primAddInt 1 b) | ||
37 | |||
38 | main :: Bool | ||
39 | main = _rhs True | ||
40 | ------------ tooltips | ||
41 | testdata/it.lc 4:1-4:5 | ||
42 | Int -> [Int] | ||
43 | testdata/it.lc 4:14-4:15 | ||
44 | _c | ||
45 | testdata/it.lc 4:14-4:16 | ||
46 | [_b] -> [_b] | ||
47 | testdata/it.lc 4:14-4:38 | ||
48 | [Int] | ||
49 | testdata/it.lc 4:15-4:16 | ||
50 | forall a . a -> [a] -> [a] | ||
51 | testdata/it.lc 4:17-4:21 | ||
52 | _d | ||
53 | testdata/it.lc 4:23-4:33 | ||
54 | Int -> Int -> Int | ||
55 | testdata/it.lc 4:23-4:35 | ||
56 | Int -> Int | ||
57 | testdata/it.lc 4:23-4:37 | ||
58 | Int | ||
59 | testdata/it.lc 4:34-4:35 | ||
60 | _b | ||
61 | testdata/it.lc 4:36-4:37 | ||
62 | _e | ||
63 | testdata/it.lc 6:1-6:5 | ||
64 | Bool | ||
65 | testdata/it.lc 6:8-7:57 | ||
66 | Bool | ||
67 | testdata/it.lc 6:13-6:17 | ||
68 | Int -> [Int] | ||
69 | testdata/it.lc 6:13-6:19 | ||
70 | [Int] | ||
71 | testdata/it.lc 6:18-6:19 | ||
72 | _b | ||
73 | testdata/it.lc 7:20-7:57 | ||
74 | Bool | Bool | Bool | Bool | ||
75 | testdata/it.lc 7:25-7:39 | ||
76 | Int -> Int -> Ordering | ||
77 | testdata/it.lc 7:25-7:41 | ||
78 | Int -> Ordering | ||
79 | testdata/it.lc 7:25-7:43 | ||
80 | Ordering | ||
81 | testdata/it.lc 7:40-7:41 | ||
82 | _c | ||
83 | testdata/it.lc 7:42-7:43 | ||
84 | _b | ||
85 | testdata/it.lc 7:53-7:57 | ||
86 | Bool | ||
87 | ------------ warnings | ||
88 | Uncovered pattern(s) at testdata/it.lc:7:25: | ||
89 | (_:_:_:i:_) -> case primCompareInt i 3 of EQ -> True | ||
90 | ^^^^^^^^^^^^^^^^^^ | ||
91 | Missing case(s): | ||
92 | LT | ||
93 | GT | ||
94 | Uncovered pattern(s) at testdata/it.lc:6:13: | ||
95 | main = case from 0 of | ||
96 | ^^^^^^ | ||
97 | Missing case(s): | ||
98 | [] | ||
99 | [_] | ||
100 | [_, _] | ||
101 | [_, _, _] \ No newline at end of file | ||
diff --git a/testdata/language-features/adt/adt01.out b/testdata/language-features/adt/adt01.out index 4791ed55..bd69397e 100644 --- a/testdata/language-features/adt/adt01.out +++ b/testdata/language-features/adt/adt01.out | |||
@@ -1 +1,187 @@ | |||
1 | True \ No newline at end of file | 1 | main :: Bool |
2 | main = True | ||
3 | ------------ desugared source code | ||
4 | data Zero :: Type where | ||
5 | |||
6 | |||
7 | data One1 (_ :: Type) :: Type where | ||
8 | One1 :: forall a . a -> One1 a | ||
9 | |||
10 | data OneInt :: Type where | ||
11 | OneI :: Int -> OneInt | ||
12 | |||
13 | data OneBool :: Type where | ||
14 | OneBool :: Bool -> OneBool | ||
15 | |||
16 | data Two (_ :: Type) (_ :: Type) :: Type where | ||
17 | TwoA :: forall a b . a -> Two a b | ||
18 | TwoB :: forall c d . d -> Two c d | ||
19 | |||
20 | value1 = _lhs value1 (_rhs (OneBool True)) | ||
21 | |||
22 | f = _lhs f \(a :: _) -> case'OneBool (\(_ :: _) -> _) (\(b :: _) -> _rhs b) a | ||
23 | |||
24 | main = _lhs main (_rhs (f value1)) | ||
25 | ------------ core code | ||
26 | 'One1 :: Type -> Type | ||
27 | 'One1 = <<type constructor with 0 indices; constructors: One1>> | ||
28 | |||
29 | 'OneBool :: Type | ||
30 | 'OneBool = <<type constructor with 0 indices; constructors: OneBool>> | ||
31 | |||
32 | 'OneInt :: Type | ||
33 | 'OneInt = <<type constructor with 0 indices; constructors: OneI>> | ||
34 | |||
35 | 'Two :: Type -> Type -> Type | ||
36 | 'Two = <<type constructor with 0 indices; constructors: TwoA, TwoB>> | ||
37 | |||
38 | 'Zero :: Type | ||
39 | 'Zero = <<type constructor with 0 indices; constructors: >> | ||
40 | |||
41 | One1 :: forall a . a -> One1 a | ||
42 | One1 = <<0th constructor of 'One1>> | ||
43 | |||
44 | OneBool :: Bool -> OneBool | ||
45 | OneBool = <<0th constructor of 'OneBool>> | ||
46 | |||
47 | OneI :: Int -> OneInt | ||
48 | OneI = <<0th constructor of 'OneInt>> | ||
49 | |||
50 | TwoA :: forall a b . a -> Two a b | ||
51 | TwoA = <<0th constructor of 'Two>> | ||
52 | |||
53 | TwoB :: forall a b . b -> Two a b | ||
54 | TwoB = <<1st constructor of 'Two>> | ||
55 | |||
56 | case'One1 | ||
57 | :: forall a | ||
58 | . forall (b :: One1 a -> Type) | ||
59 | -> (forall (c :: a) -> b ('One1 c)) -> forall (d :: One1 a) -> b d | ||
60 | case'One1 = \_ a b c -> <<case function of a type with 1 parameters>> | ||
61 | |||
62 | case'OneBool | ||
63 | :: forall (a :: OneBool -> Type) | ||
64 | -> (forall (b :: Bool) -> a ('OneBool b)) -> forall (c :: OneBool) -> a c | ||
65 | case'OneBool = \a b c -> <<case function of a type with 0 parameters>> | ||
66 | |||
67 | case'OneInt | ||
68 | :: forall (a :: OneInt -> Type) | ||
69 | -> (forall (b :: Int) -> a ('OneI b)) -> forall (c :: OneInt) -> a c | ||
70 | case'OneInt = \a b c -> <<case function of a type with 0 parameters>> | ||
71 | |||
72 | case'Two | ||
73 | :: forall a b | ||
74 | . forall (c :: Two a b -> Type) | ||
75 | -> (forall (d :: a) -> c ('TwoA d)) | ||
76 | -> (forall (e :: b) -> c ('TwoB e)) -> forall (f :: Two a b) -> c f | ||
77 | case'Two = \_ _ a b c d -> <<case function of a type with 2 parameters>> | ||
78 | |||
79 | case'Zero :: forall (a :: Zero -> Type) (b :: Zero) -> a b | ||
80 | case'Zero = \a b -> <<case function of a type with 0 parameters>> | ||
81 | |||
82 | f :: OneBool -> Bool | ||
83 | f = \a -> case'OneBool (\_ -> 'Bool) (\b -> _rhs b) a | ||
84 | |||
85 | main :: Bool | ||
86 | main = _rhs True | ||
87 | |||
88 | match'One1 | ||
89 | :: forall (a :: Type -> Type) | ||
90 | -> (forall b -> a (One1 b)) -> forall c -> a c -> a c | ||
91 | match'One1 = \a b c d -> <<type case function>> | ||
92 | |||
93 | match'OneBool | ||
94 | :: forall (a :: Type -> Type) -> a OneBool -> forall b -> a b -> a b | ||
95 | match'OneBool = \a b c d -> <<type case function>> | ||
96 | |||
97 | match'OneInt :: forall (a :: Type -> Type) -> a OneInt -> forall b -> a b -> a b | ||
98 | match'OneInt = \a b c d -> <<type case function>> | ||
99 | |||
100 | match'Two | ||
101 | :: forall (a :: Type -> Type) | ||
102 | -> (forall b c -> a (Two b c)) -> forall d -> a d -> a d | ||
103 | match'Two = \a b c d -> <<type case function>> | ||
104 | |||
105 | match'Zero :: forall (a :: Type -> Type) -> a Zero -> forall b -> a b -> a b | ||
106 | match'Zero = \a b c d -> <<type case function>> | ||
107 | |||
108 | value1 :: OneBool | ||
109 | value1 = _rhs (OneBool True) | ||
110 | ------------ tooltips | ||
111 | testdata/language-features/adt/adt01.lc 1:6-1:10 | ||
112 | Type | Type | Type | Type | ||
113 | testdata/language-features/adt/adt01.lc 3:6-3:10 | ||
114 | Type -> Type | Type -> Type | Type -> Type | Type -> Type | Type | ||
115 | testdata/language-features/adt/adt01.lc 3:6-3:12 | ||
116 | Type | Type | ||
117 | testdata/language-features/adt/adt01.lc 3:6-3:19 | ||
118 | Type | Type | ||
119 | testdata/language-features/adt/adt01.lc 3:6-3:21 | ||
120 | Type | ||
121 | testdata/language-features/adt/adt01.lc 3:11-3:12 | ||
122 | Type | ||
123 | testdata/language-features/adt/adt01.lc 3:15-3:19 | ||
124 | forall a . a -> One1 a | One1 _c | Type | Type | ||
125 | testdata/language-features/adt/adt01.lc 3:20-3:21 | ||
126 | Type | ||
127 | testdata/language-features/adt/adt01.lc 5:6-5:12 | ||
128 | Type | Type | Type | Type | Type | Type | ||
129 | testdata/language-features/adt/adt01.lc 5:6-5:19 | ||
130 | Type | ||
131 | testdata/language-features/adt/adt01.lc 5:15-5:19 | ||
132 | Int -> OneInt | OneInt | Type | Type | ||
133 | testdata/language-features/adt/adt01.lc 5:20-5:23 | ||
134 | Type | ||
135 | testdata/language-features/adt/adt01.lc 7:6-7:13 | ||
136 | Type | Type | Type | Type | Type | Type | ||
137 | testdata/language-features/adt/adt01.lc 7:6-7:23 | ||
138 | Type | ||
139 | testdata/language-features/adt/adt01.lc 7:16-7:23 | ||
140 | Bool -> OneBool | OneBool | Type | Type | ||
141 | testdata/language-features/adt/adt01.lc 7:24-7:28 | ||
142 | Type | ||
143 | testdata/language-features/adt/adt01.lc 9:6-9:9 | ||
144 | Type -> Type -> Type | Type -> Type -> Type | Type -> Type -> Type | Type | ||
145 | -> Type -> Type | Type -> Type -> Type | Type | ||
146 | testdata/language-features/adt/adt01.lc 9:6-9:11 | ||
147 | Type -> Type | Type -> Type | ||
148 | testdata/language-features/adt/adt01.lc 9:6-9:13 | ||
149 | Type | Type | Type | Type | ||
150 | testdata/language-features/adt/adt01.lc 9:6-10:11 | ||
151 | Type | Type | ||
152 | testdata/language-features/adt/adt01.lc 9:6-11:9 | ||
153 | Type | Type | Type | Type | ||
154 | testdata/language-features/adt/adt01.lc 9:6-11:11 | ||
155 | Type | Type | ||
156 | testdata/language-features/adt/adt01.lc 9:10-9:11 | ||
157 | Type | Type | ||
158 | testdata/language-features/adt/adt01.lc 9:12-9:13 | ||
159 | Type | Type | ||
160 | testdata/language-features/adt/adt01.lc 10:5-10:9 | ||
161 | forall a b . a -> Two a b | Two _d _c | Type | Type | ||
162 | testdata/language-features/adt/adt01.lc 10:10-10:11 | ||
163 | Type | ||
164 | testdata/language-features/adt/adt01.lc 11:5-11:9 | ||
165 | forall a b . b -> Two a b | Two _e _d | Type | Type | ||
166 | testdata/language-features/adt/adt01.lc 11:10-11:11 | ||
167 | Type | ||
168 | testdata/language-features/adt/adt01.lc 13:1-13:7 | ||
169 | OneBool | ||
170 | testdata/language-features/adt/adt01.lc 13:10-13:17 | ||
171 | Bool -> OneBool | ||
172 | testdata/language-features/adt/adt01.lc 13:10-13:22 | ||
173 | OneBool | ||
174 | testdata/language-features/adt/adt01.lc 13:18-13:22 | ||
175 | Bool | ||
176 | testdata/language-features/adt/adt01.lc 15:1-15:2 | ||
177 | OneBool -> Bool | ||
178 | testdata/language-features/adt/adt01.lc 15:17-15:18 | ||
179 | Bool | ||
180 | testdata/language-features/adt/adt01.lc 17:1-17:5 | ||
181 | Bool | ||
182 | testdata/language-features/adt/adt01.lc 17:8-17:9 | ||
183 | OneBool -> Bool | ||
184 | testdata/language-features/adt/adt01.lc 17:8-17:16 | ||
185 | Bool | ||
186 | testdata/language-features/adt/adt01.lc 17:10-17:16 | ||
187 | OneBool \ No newline at end of file | ||
diff --git a/testdata/language-features/adt/adt02.out b/testdata/language-features/adt/adt02.out index 4791ed55..84ef7d80 100644 --- a/testdata/language-features/adt/adt02.out +++ b/testdata/language-features/adt/adt02.out | |||
@@ -1 +1,289 @@ | |||
1 | True \ No newline at end of file | 1 | main :: Bool |
2 | main = True | ||
3 | ------------ desugared source code | ||
4 | data Data1 :: Type where | ||
5 | Data1 :: Bool -> Data1 | ||
6 | |||
7 | one1 | ||
8 | = _lhs one1 \(a :: _) -> case'Data1 (\(_ :: _) -> _) (\(b :: _) -> _rhs b) a | ||
9 | |||
10 | data Data2 :: Type where | ||
11 | Data2 :: Bool -> String -> Bool -> Data2 | ||
12 | |||
13 | one2 | ||
14 | = _lhs | ||
15 | one2 | ||
16 | \(a :: _) -> case'Data2 | ||
17 | (\(_ :: _) -> _) | ||
18 | (\(b :: _) (_ :: _) (_ :: _) -> _rhs b) | ||
19 | a | ||
20 | |||
21 | two2 | ||
22 | = _lhs | ||
23 | two2 | ||
24 | \(a :: _) -> case'Data2 | ||
25 | (\(_ :: _) -> _) | ||
26 | (\(_ :: _) (b :: _) (_ :: _) -> _rhs b) | ||
27 | a | ||
28 | |||
29 | thr2 | ||
30 | = _lhs | ||
31 | thr2 | ||
32 | \(a :: _) -> case'Data2 | ||
33 | (\(_ :: _) -> _) | ||
34 | (\(_ :: _) (_ :: _) (b :: _) -> _rhs b) | ||
35 | a | ||
36 | |||
37 | value1 = _lhs value1 (_rhs (Data1 True)) | ||
38 | |||
39 | value2 = _lhs value2 (_rhs (Data2 True "friend" True)) | ||
40 | |||
41 | data Data3 (_ :: Type) (_ :: Type) (_ :: Type) :: Type where | ||
42 | Data3 :: forall a b c . a -> b -> c -> Data3 a b c | ||
43 | |||
44 | one3 | ||
45 | = _lhs | ||
46 | one3 | ||
47 | \(a :: _) -> case'Data3 | ||
48 | (\(_ :: _) -> _) | ||
49 | (\(b :: _) (_ :: _) (_ :: _) -> _rhs b) | ||
50 | a | ||
51 | |||
52 | two3 | ||
53 | = _lhs | ||
54 | two3 | ||
55 | \(a :: _) -> case'Data3 | ||
56 | (\(_ :: _) -> _) | ||
57 | (\(_ :: _) (b :: _) (_ :: _) -> _rhs b) | ||
58 | a | ||
59 | |||
60 | thr3 | ||
61 | = _lhs | ||
62 | thr3 | ||
63 | \(a :: _) -> case'Data3 | ||
64 | (\(_ :: _) -> _) | ||
65 | (\(_ :: _) (_ :: _) (b :: _) -> _rhs b) | ||
66 | a | ||
67 | |||
68 | value3 = _lhs value3 (_rhs (Data3 True True True)) | ||
69 | |||
70 | main = _lhs main (_rhs (one2 value2 && thr2 value2 && one3 value3)) | ||
71 | ------------ core code | ||
72 | 'Data1 :: Type | ||
73 | 'Data1 = <<type constructor with 0 indices; constructors: Data1>> | ||
74 | |||
75 | 'Data2 :: Type | ||
76 | 'Data2 = <<type constructor with 0 indices; constructors: Data2>> | ||
77 | |||
78 | 'Data3 :: Type -> Type -> Type -> Type | ||
79 | 'Data3 = <<type constructor with 0 indices; constructors: Data3>> | ||
80 | |||
81 | Data1 :: Bool -> Data1 | ||
82 | Data1 = <<0th constructor of 'Data1>> | ||
83 | |||
84 | Data2 :: Bool -> String -> Bool -> Data2 | ||
85 | Data2 = <<0th constructor of 'Data2>> | ||
86 | |||
87 | Data3 :: forall a b c . a -> b -> c -> Data3 a b c | ||
88 | Data3 = <<0th constructor of 'Data3>> | ||
89 | |||
90 | case'Data1 | ||
91 | :: forall (a :: Data1 -> Type) | ||
92 | -> (forall (b :: Bool) -> a ('Data1 b)) -> forall (c :: Data1) -> a c | ||
93 | case'Data1 = \a b c -> <<case function of a type with 0 parameters>> | ||
94 | |||
95 | case'Data2 | ||
96 | :: forall (a :: Data2 -> Type) | ||
97 | -> (forall (b :: Bool) (c :: String) (d :: Bool) -> a ('Data2 b c d)) | ||
98 | -> forall (e :: Data2) -> a e | ||
99 | case'Data2 = \a b c -> <<case function of a type with 0 parameters>> | ||
100 | |||
101 | case'Data3 | ||
102 | :: forall a b c | ||
103 | . forall (d :: Data3 a b c -> Type) | ||
104 | -> (forall (e :: a) (f :: b) (g :: c) -> d ('Data3 e f g)) | ||
105 | -> forall (h :: Data3 a b c) -> d h | ||
106 | case'Data3 = \_ _ _ a b c -> <<case function of a type with 3 parameters>> | ||
107 | |||
108 | main :: Bool | ||
109 | main = _rhs True | ||
110 | |||
111 | match'Data1 :: forall (a :: Type -> Type) -> a Data1 -> forall b -> a b -> a b | ||
112 | match'Data1 = \a b c d -> <<type case function>> | ||
113 | |||
114 | match'Data2 :: forall (a :: Type -> Type) -> a Data2 -> forall b -> a b -> a b | ||
115 | match'Data2 = \a b c d -> <<type case function>> | ||
116 | |||
117 | match'Data3 | ||
118 | :: forall (a :: Type -> Type) | ||
119 | -> (forall b c d -> a (Data3 b c d)) -> forall e -> a e -> a e | ||
120 | match'Data3 = \a b c d -> <<type case function>> | ||
121 | |||
122 | one1 :: Data1 -> Bool | ||
123 | one1 = \a -> case'Data1 (\_ -> 'Bool) (\b -> _rhs b) a | ||
124 | |||
125 | one2 :: Data2 -> Bool | ||
126 | one2 = \a -> case'Data2 (\_ -> 'Bool) (\b _ _ -> _rhs b) a | ||
127 | |||
128 | one3 :: forall a b c . Data3 a b c -> a | ||
129 | one3 = \a _ _ b -> case'Data3 (\_ -> a) (\c _ _ -> _rhs c) b | ||
130 | |||
131 | thr2 :: Data2 -> Bool | ||
132 | thr2 = \a -> case'Data2 (\_ -> 'Bool) (\_ _ b -> _rhs b) a | ||
133 | |||
134 | thr3 :: forall a b c . Data3 a b c -> c | ||
135 | thr3 = \_ _ a b -> case'Data3 (\_ -> a) (\_ _ c -> _rhs c) b | ||
136 | |||
137 | two2 :: Data2 -> String | ||
138 | two2 = \a -> case'Data2 (\_ -> 'String) (\_ b _ -> _rhs b) a | ||
139 | |||
140 | two3 :: forall a b c . Data3 a b c -> b | ||
141 | two3 = \_ a _ b -> case'Data3 (\_ -> a) (\_ c _ -> _rhs c) b | ||
142 | |||
143 | value1 :: Data1 | ||
144 | value1 = _rhs (Data1 True) | ||
145 | |||
146 | value2 :: Data2 | ||
147 | value2 = _rhs (Data2 True "friend" True) | ||
148 | |||
149 | value3 :: Data3 Bool Bool Bool | ||
150 | value3 = _rhs (Data3 True True True) | ||
151 | ------------ tooltips | ||
152 | testdata/language-features/adt/adt02.lc 1:6-1:11 | ||
153 | Type | Type | Type | Type | Type | Type | ||
154 | testdata/language-features/adt/adt02.lc 1:6-1:19 | ||
155 | Type | ||
156 | testdata/language-features/adt/adt02.lc 1:14-1:19 | ||
157 | Bool -> Data1 | Data1 | Type | Type | ||
158 | testdata/language-features/adt/adt02.lc 1:22-1:26 | ||
159 | Data1 -> Bool | ||
160 | testdata/language-features/adt/adt02.lc 1:30-1:34 | ||
161 | Type | ||
162 | testdata/language-features/adt/adt02.lc 3:6-3:11 | ||
163 | Type | Type | Type | Type | Type | Type | ||
164 | testdata/language-features/adt/adt02.lc 3:6-3:19 | ||
165 | Type | ||
166 | testdata/language-features/adt/adt02.lc 3:6-6:17 | ||
167 | Type | Type | ||
168 | testdata/language-features/adt/adt02.lc 3:14-3:19 | ||
169 | Bool -> String -> Bool -> Data2 | Data2 | Type | Type | Type | Type | ||
170 | testdata/language-features/adt/adt02.lc 4:5-4:9 | ||
171 | Data2 -> Bool | ||
172 | testdata/language-features/adt/adt02.lc 4:13-4:17 | ||
173 | Type | ||
174 | testdata/language-features/adt/adt02.lc 5:5-5:9 | ||
175 | Data2 -> String | ||
176 | testdata/language-features/adt/adt02.lc 5:13-5:19 | ||
177 | Type | ||
178 | testdata/language-features/adt/adt02.lc 6:5-6:9 | ||
179 | Data2 -> Bool | ||
180 | testdata/language-features/adt/adt02.lc 6:13-6:17 | ||
181 | Type | ||
182 | testdata/language-features/adt/adt02.lc 9:1-9:7 | ||
183 | Data1 | ||
184 | testdata/language-features/adt/adt02.lc 9:10-9:15 | ||
185 | Bool -> Data1 | ||
186 | testdata/language-features/adt/adt02.lc 9:10-9:20 | ||
187 | Data1 | ||
188 | testdata/language-features/adt/adt02.lc 9:16-9:20 | ||
189 | Bool | ||
190 | testdata/language-features/adt/adt02.lc 10:1-10:7 | ||
191 | Data2 | ||
192 | testdata/language-features/adt/adt02.lc 10:10-10:15 | ||
193 | Bool -> String -> Bool -> Data2 | ||
194 | testdata/language-features/adt/adt02.lc 10:10-10:20 | ||
195 | String -> Bool -> Data2 | ||
196 | testdata/language-features/adt/adt02.lc 10:10-10:29 | ||
197 | Bool -> Data2 | ||
198 | testdata/language-features/adt/adt02.lc 10:10-10:34 | ||
199 | Data2 | ||
200 | testdata/language-features/adt/adt02.lc 10:16-10:20 | ||
201 | Bool | ||
202 | testdata/language-features/adt/adt02.lc 10:21-10:29 | ||
203 | String | ||
204 | testdata/language-features/adt/adt02.lc 10:30-10:34 | ||
205 | Bool | ||
206 | testdata/language-features/adt/adt02.lc 12:6-12:11 | ||
207 | Type -> Type -> Type -> Type | Type -> Type -> Type -> Type | Type | ||
208 | -> Type -> Type -> Type | Type -> Type -> Type -> Type | Type | ||
209 | testdata/language-features/adt/adt02.lc 12:6-12:13 | ||
210 | Type -> Type -> Type | ||
211 | testdata/language-features/adt/adt02.lc 12:6-12:15 | ||
212 | Type -> Type | ||
213 | testdata/language-features/adt/adt02.lc 12:6-12:17 | ||
214 | Type | Type | ||
215 | testdata/language-features/adt/adt02.lc 12:6-12:25 | ||
216 | Type | Type | Type | Type | ||
217 | testdata/language-features/adt/adt02.lc 12:6-15:14 | ||
218 | Type | Type | Type | Type | Type | ||
219 | testdata/language-features/adt/adt02.lc 12:12-12:13 | ||
220 | Type | ||
221 | testdata/language-features/adt/adt02.lc 12:14-12:15 | ||
222 | Type | ||
223 | testdata/language-features/adt/adt02.lc 12:16-12:17 | ||
224 | Type | ||
225 | testdata/language-features/adt/adt02.lc 12:20-12:25 | ||
226 | forall a b c . a -> b -> c -> Data3 a b c | Data3 | ||
227 | _g | ||
228 | _f | ||
229 | _e | Type | Type | Type | Type | ||
230 | testdata/language-features/adt/adt02.lc 13:5-13:9 | ||
231 | forall a b c . Data3 a b c -> a | ||
232 | testdata/language-features/adt/adt02.lc 13:13-13:14 | ||
233 | Type | ||
234 | testdata/language-features/adt/adt02.lc 14:5-14:9 | ||
235 | forall a b c . Data3 a b c -> b | ||
236 | testdata/language-features/adt/adt02.lc 14:13-14:14 | ||
237 | Type | ||
238 | testdata/language-features/adt/adt02.lc 15:5-15:9 | ||
239 | forall a b c . Data3 a b c -> c | ||
240 | testdata/language-features/adt/adt02.lc 15:13-15:14 | ||
241 | Type | ||
242 | testdata/language-features/adt/adt02.lc 18:1-18:7 | ||
243 | Data3 Bool Bool Bool | ||
244 | testdata/language-features/adt/adt02.lc 18:10-18:15 | ||
245 | forall a b c . a -> b -> c -> Data3 a b c | ||
246 | testdata/language-features/adt/adt02.lc 18:10-18:20 | ||
247 | _b -> _a -> Data3 Bool _b _a | ||
248 | testdata/language-features/adt/adt02.lc 18:10-18:25 | ||
249 | _a -> Data3 Bool Bool _a | ||
250 | testdata/language-features/adt/adt02.lc 18:10-18:30 | ||
251 | Data3 Bool Bool Bool | ||
252 | testdata/language-features/adt/adt02.lc 18:16-18:20 | ||
253 | Bool | ||
254 | testdata/language-features/adt/adt02.lc 18:21-18:25 | ||
255 | Bool | ||
256 | testdata/language-features/adt/adt02.lc 18:26-18:30 | ||
257 | Bool | ||
258 | testdata/language-features/adt/adt02.lc 20:1-20:5 | ||
259 | Bool | ||
260 | testdata/language-features/adt/adt02.lc 20:8-20:12 | ||
261 | Data2 -> Bool | ||
262 | testdata/language-features/adt/adt02.lc 20:8-20:19 | ||
263 | Bool | ||
264 | testdata/language-features/adt/adt02.lc 20:8-20:22 | ||
265 | Bool -> Bool | ||
266 | testdata/language-features/adt/adt02.lc 20:8-20:49 | ||
267 | Bool | ||
268 | testdata/language-features/adt/adt02.lc 20:13-20:19 | ||
269 | Data2 | ||
270 | testdata/language-features/adt/adt02.lc 20:20-20:22 | ||
271 | Bool -> Bool -> Bool | ||
272 | testdata/language-features/adt/adt02.lc 20:23-20:27 | ||
273 | Data2 -> Bool | ||
274 | testdata/language-features/adt/adt02.lc 20:23-20:34 | ||
275 | Bool | ||
276 | testdata/language-features/adt/adt02.lc 20:23-20:37 | ||
277 | Bool -> Bool | ||
278 | testdata/language-features/adt/adt02.lc 20:23-20:49 | ||
279 | Bool | ||
280 | testdata/language-features/adt/adt02.lc 20:28-20:34 | ||
281 | Data2 | ||
282 | testdata/language-features/adt/adt02.lc 20:35-20:37 | ||
283 | Bool -> Bool -> Bool | ||
284 | testdata/language-features/adt/adt02.lc 20:38-20:42 | ||
285 | forall a b c . Data3 a b c -> a | ||
286 | testdata/language-features/adt/adt02.lc 20:38-20:49 | ||
287 | Bool | ||
288 | testdata/language-features/adt/adt02.lc 20:43-20:49 | ||
289 | Data3 Bool Bool Bool \ No newline at end of file | ||
diff --git a/testdata/language-features/adt/adt05.out b/testdata/language-features/adt/adt05.out index 2f1af5ee..c44d22b9 100644 --- a/testdata/language-features/adt/adt05.out +++ b/testdata/language-features/adt/adt05.out | |||
@@ -1,3 +1,142 @@ | |||
1 | testdata/language-features/adt/adt05.lc:14:1: | 1 | main :: @Type -> forall a . Num a => Bool |
2 | main = isEmpty value1 && isCons value2 | 2 | main = main |
3 | ^^^^ \ No newline at end of file | 3 | ------------ desugared source code |
4 | data TList (_ :: Type) :: Type where | ||
5 | TEmpty :: forall a . TList a | ||
6 | TCons :: forall b . b -> TList b -> TList b | ||
7 | |||
8 | value1 = _lhs value1 (_rhs TEmpty) | ||
9 | |||
10 | value2 = _lhs value2 (_rhs (TCons (fromInt 3) value1)) | ||
11 | |||
12 | isEmpty | ||
13 | = _lhs | ||
14 | isEmpty | ||
15 | \(a :: _) -> case'TList | ||
16 | (\(_ :: _) -> _) | ||
17 | (_rhs True) | ||
18 | (\(_ :: _) (_ :: _) -> _rhs False) | ||
19 | a | ||
20 | |||
21 | isCons | ||
22 | = _lhs | ||
23 | isCons | ||
24 | \(a :: _) -> case'TList | ||
25 | (\(_ :: _) -> _) | ||
26 | (_rhs False) | ||
27 | (\(_ :: _) (_ :: _) -> _rhs True) | ||
28 | a | ||
29 | |||
30 | main = _lhs main (_rhs (isEmpty value1 && isCons value2)) | ||
31 | ------------ core code | ||
32 | 'TList :: Type -> Type | ||
33 | 'TList = <<type constructor with 0 indices; constructors: TEmpty, TCons>> | ||
34 | |||
35 | TCons :: forall a . a -> TList a -> TList a | ||
36 | TCons = <<1st constructor of 'TList>> | ||
37 | |||
38 | TEmpty :: forall a . TList a | ||
39 | TEmpty = <<0th constructor of 'TList>> | ||
40 | |||
41 | case'TList | ||
42 | :: forall a | ||
43 | . forall (b :: TList a -> Type) | ||
44 | -> b 'TEmpty | ||
45 | -> (forall (c :: a) (d :: TList a) -> b ('TCons c d)) | ||
46 | -> forall (e :: TList a) -> b e | ||
47 | case'TList = \_ a b c d -> <<case function of a type with 1 parameters>> | ||
48 | |||
49 | isCons :: forall a . TList a -> Bool | ||
50 | isCons = \_ a -> case'TList (\_ -> 'Bool) (_rhs False) (\_ _ -> _rhs True) a | ||
51 | |||
52 | isEmpty :: forall a . TList a -> Bool | ||
53 | isEmpty = \_ a -> case'TList (\_ -> 'Bool) (_rhs True) (\_ _ -> _rhs False) a | ||
54 | |||
55 | main :: @Type -> forall a . Num a => Bool | ||
56 | main = \_ _ _ -> _rhs True | ||
57 | |||
58 | match'TList | ||
59 | :: forall (a :: Type -> Type) | ||
60 | -> (forall b -> a (TList b)) -> forall c -> a c -> a c | ||
61 | match'TList = \a b c d -> <<type case function>> | ||
62 | |||
63 | value1 :: forall a . TList a | ||
64 | value1 = _rhs TEmpty | ||
65 | |||
66 | value2 :: forall a . Num a => TList a | ||
67 | value2 = \a b -> _rhs (TCons (fromInt a b 3) TEmpty) | ||
68 | ------------ tooltips | ||
69 | testdata/language-features/adt/adt05.lc 3:6-3:11 | ||
70 | Type -> Type | Type -> Type | Type -> Type | Type -> Type | Type -> Type | Type | ||
71 | testdata/language-features/adt/adt05.lc 3:6-3:13 | ||
72 | Type | Type | Type | Type | ||
73 | testdata/language-features/adt/adt05.lc 3:6-3:30 | ||
74 | Type | Type | Type | ||
75 | testdata/language-features/adt/adt05.lc 3:6-3:42 | ||
76 | Type | Type | ||
77 | testdata/language-features/adt/adt05.lc 3:12-3:13 | ||
78 | Type | Type | ||
79 | testdata/language-features/adt/adt05.lc 3:16-3:22 | ||
80 | forall a . TList a | TList _b | ||
81 | testdata/language-features/adt/adt05.lc 3:25-3:30 | ||
82 | forall a . a -> TList a -> TList a | TList _e | Type | Type | Type | ||
83 | testdata/language-features/adt/adt05.lc 3:31-3:32 | ||
84 | Type | ||
85 | testdata/language-features/adt/adt05.lc 3:34-3:39 | ||
86 | Type -> Type | ||
87 | testdata/language-features/adt/adt05.lc 3:34-3:41 | ||
88 | Type | ||
89 | testdata/language-features/adt/adt05.lc 3:40-3:41 | ||
90 | Type | ||
91 | testdata/language-features/adt/adt05.lc 5:1-5:7 | ||
92 | forall a . TList a | ||
93 | testdata/language-features/adt/adt05.lc 5:10-5:16 | ||
94 | forall a . TList a | ||
95 | testdata/language-features/adt/adt05.lc 6:1-6:7 | ||
96 | forall a . Num a => TList a | ||
97 | testdata/language-features/adt/adt05.lc 6:10-6:15 | ||
98 | forall a . a -> TList a -> TList a | ||
99 | testdata/language-features/adt/adt05.lc 6:10-6:17 | ||
100 | TList _b -> TList _b | ||
101 | testdata/language-features/adt/adt05.lc 6:10-6:24 | ||
102 | TList _b | ||
103 | testdata/language-features/adt/adt05.lc 6:16-6:17 | ||
104 | _b | ||
105 | testdata/language-features/adt/adt05.lc 6:18-6:24 | ||
106 | forall a . TList a | ||
107 | testdata/language-features/adt/adt05.lc 8:1-8:8 | ||
108 | forall a . TList a -> Bool | ||
109 | testdata/language-features/adt/adt05.lc 8:18-8:22 | ||
110 | Bool | ||
111 | testdata/language-features/adt/adt05.lc 8:18-9:23 | ||
112 | TList _a -> Bool | ||
113 | testdata/language-features/adt/adt05.lc 9:18-9:23 | ||
114 | Bool | ||
115 | testdata/language-features/adt/adt05.lc 11:1-11:7 | ||
116 | forall a . TList a -> Bool | ||
117 | testdata/language-features/adt/adt05.lc 11:22-11:26 | ||
118 | Bool | ||
119 | testdata/language-features/adt/adt05.lc 11:22-12:27 | ||
120 | TList _a -> Bool | ||
121 | testdata/language-features/adt/adt05.lc 12:22-12:27 | ||
122 | Bool | ||
123 | testdata/language-features/adt/adt05.lc 14:1-14:5 | ||
124 | @Type -> forall a . Num a => Bool | ||
125 | testdata/language-features/adt/adt05.lc 14:8-14:15 | ||
126 | forall a . TList a -> Bool | ||
127 | testdata/language-features/adt/adt05.lc 14:8-14:22 | ||
128 | Bool | ||
129 | testdata/language-features/adt/adt05.lc 14:8-14:25 | ||
130 | Bool -> Bool | ||
131 | testdata/language-features/adt/adt05.lc 14:8-14:39 | ||
132 | Bool | ||
133 | testdata/language-features/adt/adt05.lc 14:16-14:22 | ||
134 | forall a . TList a | ||
135 | testdata/language-features/adt/adt05.lc 14:23-14:25 | ||
136 | Bool -> Bool -> Bool | ||
137 | testdata/language-features/adt/adt05.lc 14:26-14:32 | ||
138 | forall a . TList a -> Bool | ||
139 | testdata/language-features/adt/adt05.lc 14:26-14:39 | ||
140 | Bool | ||
141 | testdata/language-features/adt/adt05.lc 14:33-14:39 | ||
142 | forall a . Num a => TList a \ No newline at end of file | ||
diff --git a/testdata/language-features/adt/gadt01.out b/testdata/language-features/adt/gadt01.out index 4791ed55..5c850279 100644 --- a/testdata/language-features/adt/gadt01.out +++ b/testdata/language-features/adt/gadt01.out | |||
@@ -1 +1,376 @@ | |||
1 | True \ No newline at end of file | 1 | main :: Bool |
2 | main = True | ||
3 | ------------ desugared source code | ||
4 | data V :: Nat -> Type -> Type where | ||
5 | V1_ :: forall (a :: _) . a -> V (fromInt 1) a | ||
6 | V2_ :: forall (b :: _) . b -> b -> V (fromInt 2) b | ||
7 | |||
8 | data M :: Type -> String -> Type where | ||
9 | Value :: forall (a :: _) . a -> forall (b :: _) . M a b | ||
10 | |||
11 | data M2 (_ :: Type) :: String -> Type where | ||
12 | Value2 :: forall a . a -> forall (b :: _) . M2 a b | ||
13 | |||
14 | data M3 (_ :: Type) :: String -> Type where | ||
15 | Value3 :: forall a (b :: _) . a -> M3 a b | ||
16 | |||
17 | g | ||
18 | = _lhs | ||
19 | g | ||
20 | (_rhs (case'M2 (\(_ :: _) (_ :: _) -> _ :: _) \(a :: _) @(_ :: _) -> a)) | ||
21 | |||
22 | h | ||
23 | = _lhs h \(a :: _) -> case'M3 (\(_ :: _) (_ :: _) -> _) (\(b :: _) -> _rhs b) a | ||
24 | |||
25 | value1 :: M Bool "m" | ||
26 | value1 = _lhs value1 (_rhs (Value True)) | ||
27 | |||
28 | value2 :: M2 Bool "s" | ||
29 | value2 = _lhs value2 (_rhs (Value2 True)) | ||
30 | |||
31 | value3 :: M3 Bool "t" | ||
32 | value3 = _lhs value3 (_rhs (Value3 True)) | ||
33 | |||
34 | main = _lhs main (_rhs (g value2 && h value3)) | ||
35 | ------------ core code | ||
36 | 'M :: Type -> String -> Type | ||
37 | 'M = <<type constructor with 2 indices; constructors: Value>> | ||
38 | |||
39 | 'M2 :: Type -> String -> Type | ||
40 | 'M2 = <<type constructor with 1 indices; constructors: Value2>> | ||
41 | |||
42 | 'M3 :: Type -> String -> Type | ||
43 | 'M3 = <<type constructor with 1 indices; constructors: Value3>> | ||
44 | |||
45 | 'V :: Nat -> Type -> Type | ||
46 | 'V = <<type constructor with 2 indices; constructors: V1_, V2_>> | ||
47 | |||
48 | V1_ :: forall a . a -> V 1 a | ||
49 | V1_ = <<0th constructor of 'V>> | ||
50 | |||
51 | V2_ :: forall a . a -> a -> V 2 a | ||
52 | V2_ = <<1st constructor of 'V>> | ||
53 | |||
54 | Value :: forall a . a -> forall (b :: String) . M a b | ||
55 | Value = <<0th constructor of 'M>> | ||
56 | |||
57 | Value2 :: forall a . a -> forall (b :: String) . M2 a b | ||
58 | Value2 = <<0th constructor of 'M2>> | ||
59 | |||
60 | Value3 :: forall a (b :: String) . a -> M3 a b | ||
61 | Value3 = <<0th constructor of 'M3>> | ||
62 | |||
63 | case'M | ||
64 | :: forall (a :: forall b (c :: String) -> M b c -> Type) | ||
65 | -> (forall d . forall (e :: d) -> forall (f :: String) . a d f ('Value d e f)) | ||
66 | -> forall g (h :: String) . forall (i :: M g h) -> a g h i | ||
67 | case'M = \a b c d e -> <<case function of a type with 0 parameters>> | ||
68 | |||
69 | case'M2 | ||
70 | :: forall a | ||
71 | . forall (b :: forall (c :: String) -> M2 a c -> Type) | ||
72 | -> (forall (d :: a) -> forall (e :: String) . b e ('Value2 d e)) | ||
73 | -> forall (f :: String) . forall (g :: M2 a f) -> b f g | ||
74 | case'M2 = \_ a b c d -> <<case function of a type with 1 parameters>> | ||
75 | |||
76 | case'M3 | ||
77 | :: forall a | ||
78 | . forall (b :: forall (c :: String) -> M3 a c -> Type) | ||
79 | -> (forall (d :: String) . forall (e :: a) -> b d ('Value3 d e)) | ||
80 | -> forall (f :: String) . forall (g :: M3 a f) -> b f g | ||
81 | case'M3 = \_ a b c d -> <<case function of a type with 1 parameters>> | ||
82 | |||
83 | case'V | ||
84 | :: forall (a :: forall (b :: Nat) c -> V b c -> Type) | ||
85 | -> (forall d . forall (e :: d) -> a 1 d ('V1_ d e)) | ||
86 | -> (forall f . forall (g :: f) (h :: f) -> a 2 f ('V2_ f g h)) | ||
87 | -> forall (i :: Nat) j . forall (k :: V i j) -> a i j k | ||
88 | case'V = \a b c d e f -> <<case function of a type with 0 parameters>> | ||
89 | |||
90 | g :: forall a (b :: String) . M2 a b -> a | ||
91 | g = \a -> _rhs \b c -> case'M2 (\_ _ -> a) (\d _ -> d) b c | ||
92 | |||
93 | h :: forall a (b :: String) . M3 a b -> a | ||
94 | h = \a b c -> case'M3 (\_ _ -> a) (\_ d -> _rhs d) b c | ||
95 | |||
96 | main :: Bool | ||
97 | main = _rhs True | ||
98 | |||
99 | match'M | ||
100 | :: forall (a :: Type -> Type) | ||
101 | -> (forall b (c :: String) -> a (M b c)) -> forall d -> a d -> a d | ||
102 | match'M = \a b c d -> <<type case function>> | ||
103 | |||
104 | match'M2 | ||
105 | :: forall (a :: Type -> Type) | ||
106 | -> (forall b (c :: String) -> a (M2 b c)) -> forall d -> a d -> a d | ||
107 | match'M2 = \a b c d -> <<type case function>> | ||
108 | |||
109 | match'M3 | ||
110 | :: forall (a :: Type -> Type) | ||
111 | -> (forall b (c :: String) -> a (M3 b c)) -> forall d -> a d -> a d | ||
112 | match'M3 = \a b c d -> <<type case function>> | ||
113 | |||
114 | match'V | ||
115 | :: forall (a :: Type -> Type) | ||
116 | -> (forall (b :: Nat) c -> a (V b c)) -> forall d -> a d -> a d | ||
117 | match'V = \a b c d -> <<type case function>> | ||
118 | |||
119 | value1 :: M Bool "m" | ||
120 | value1 = _rhs (Value 'Bool True "m") | ||
121 | |||
122 | value2 :: M2 Bool "s" | ||
123 | value2 = _rhs (Value2 True "s") | ||
124 | |||
125 | value3 :: M3 Bool "t" | ||
126 | value3 = _rhs (Value3 "t" True) | ||
127 | ------------ tooltips | ||
128 | testdata/language-features/adt/gadt01.lc 2:6-2:7 | ||
129 | Nat -> Type -> Type | Nat -> Type -> Type | Type | Type | Nat | ||
130 | -> Type -> Type | Type | Type | Type | ||
131 | testdata/language-features/adt/gadt01.lc 2:6-4:25 | ||
132 | Type | Type | ||
133 | testdata/language-features/adt/gadt01.lc 2:11-2:14 | ||
134 | Type | ||
135 | testdata/language-features/adt/gadt01.lc 2:18-2:22 | ||
136 | Type | ||
137 | testdata/language-features/adt/gadt01.lc 2:18-2:30 | ||
138 | Type | ||
139 | testdata/language-features/adt/gadt01.lc 2:26-2:30 | ||
140 | Type | Type | ||
141 | testdata/language-features/adt/gadt01.lc 3:3-3:6 | ||
142 | forall a . a -> V 1 a | V 1 _b | ||
143 | testdata/language-features/adt/gadt01.lc 3:3-3:20 | ||
144 | Type | Type | Type | ||
145 | testdata/language-features/adt/gadt01.lc 3:10-3:11 | ||
146 | _b | ||
147 | testdata/language-features/adt/gadt01.lc 3:10-3:20 | ||
148 | Type | ||
149 | testdata/language-features/adt/gadt01.lc 3:15-3:16 | ||
150 | Nat -> Type -> Type | ||
151 | testdata/language-features/adt/gadt01.lc 3:15-3:18 | ||
152 | Type -> Type | ||
153 | testdata/language-features/adt/gadt01.lc 3:15-3:20 | ||
154 | Type | Type | ||
155 | testdata/language-features/adt/gadt01.lc 3:17-3:18 | ||
156 | _b | _b | ||
157 | testdata/language-features/adt/gadt01.lc 3:17-3:20 | ||
158 | V 1 _b -> Type | ||
159 | testdata/language-features/adt/gadt01.lc 3:19-3:20 | ||
160 | Type | Type | ||
161 | testdata/language-features/adt/gadt01.lc 4:3-4:6 | ||
162 | forall a . a -> a -> V 2 a | V 2 _c | ||
163 | testdata/language-features/adt/gadt01.lc 4:3-4:25 | ||
164 | Type | Type | Type | Type | ||
165 | testdata/language-features/adt/gadt01.lc 4:10-4:11 | ||
166 | _b | ||
167 | testdata/language-features/adt/gadt01.lc 4:10-4:25 | ||
168 | Type | ||
169 | testdata/language-features/adt/gadt01.lc 4:15-4:16 | ||
170 | Type | ||
171 | testdata/language-features/adt/gadt01.lc 4:15-4:25 | ||
172 | Type | ||
173 | testdata/language-features/adt/gadt01.lc 4:20-4:21 | ||
174 | Nat -> Type -> Type | ||
175 | testdata/language-features/adt/gadt01.lc 4:20-4:23 | ||
176 | Type -> Type | ||
177 | testdata/language-features/adt/gadt01.lc 4:20-4:25 | ||
178 | Type | Type | ||
179 | testdata/language-features/adt/gadt01.lc 4:22-4:23 | ||
180 | _b | _b | ||
181 | testdata/language-features/adt/gadt01.lc 4:22-4:25 | ||
182 | V 2 _c -> Type | ||
183 | testdata/language-features/adt/gadt01.lc 4:24-4:25 | ||
184 | Type | Type | ||
185 | testdata/language-features/adt/gadt01.lc 6:6-6:7 | ||
186 | Type -> String -> Type | Type -> String -> Type | Type | Type | Type | ||
187 | -> String -> Type | Type | Type | Type | ||
188 | testdata/language-features/adt/gadt01.lc 6:6-7:33 | ||
189 | Type | ||
190 | testdata/language-features/adt/gadt01.lc 6:11-6:15 | ||
191 | Type | ||
192 | testdata/language-features/adt/gadt01.lc 6:19-6:25 | ||
193 | Type | ||
194 | testdata/language-features/adt/gadt01.lc 6:19-6:33 | ||
195 | Type | ||
196 | testdata/language-features/adt/gadt01.lc 6:29-6:33 | ||
197 | Type | Type | ||
198 | testdata/language-features/adt/gadt01.lc 7:3-7:8 | ||
199 | forall a . a -> forall (b :: String) . M a b | M _c _a | ||
200 | testdata/language-features/adt/gadt01.lc 7:3-7:33 | ||
201 | Type | Type | Type | Type | ||
202 | testdata/language-features/adt/gadt01.lc 7:12-7:13 | ||
203 | _b | ||
204 | testdata/language-features/adt/gadt01.lc 7:12-7:33 | ||
205 | Type | ||
206 | testdata/language-features/adt/gadt01.lc 7:17-7:33 | ||
207 | Type | ||
208 | testdata/language-features/adt/gadt01.lc 7:28-7:29 | ||
209 | Type -> String -> Type | ||
210 | testdata/language-features/adt/gadt01.lc 7:28-7:31 | ||
211 | String -> Type | ||
212 | testdata/language-features/adt/gadt01.lc 7:28-7:33 | ||
213 | Type | Type | ||
214 | testdata/language-features/adt/gadt01.lc 7:30-7:31 | ||
215 | Type | Type | ||
216 | testdata/language-features/adt/gadt01.lc 7:30-7:33 | ||
217 | M _c _a -> Type | ||
218 | testdata/language-features/adt/gadt01.lc 7:32-7:33 | ||
219 | _b | String | ||
220 | testdata/language-features/adt/gadt01.lc 9:6-9:8 | ||
221 | Type -> String -> Type | Type -> String -> Type | Type | Type | ||
222 | -> String -> Type | Type | Type | ||
223 | testdata/language-features/adt/gadt01.lc 9:6-10:35 | ||
224 | Type | Type | ||
225 | testdata/language-features/adt/gadt01.lc 9:15-9:19 | ||
226 | Type | Type | Type | ||
227 | testdata/language-features/adt/gadt01.lc 9:24-9:30 | ||
228 | Type | ||
229 | testdata/language-features/adt/gadt01.lc 9:24-9:38 | ||
230 | Type | ||
231 | testdata/language-features/adt/gadt01.lc 9:34-9:38 | ||
232 | Type | Type | ||
233 | testdata/language-features/adt/gadt01.lc 10:3-10:9 | ||
234 | forall a . a -> forall (b :: String) . M2 a b | M2 _d _a | ||
235 | testdata/language-features/adt/gadt01.lc 10:3-10:35 | ||
236 | Type | Type | Type | ||
237 | testdata/language-features/adt/gadt01.lc 10:13-10:14 | ||
238 | Type | ||
239 | testdata/language-features/adt/gadt01.lc 10:13-10:35 | ||
240 | Type | ||
241 | testdata/language-features/adt/gadt01.lc 10:18-10:35 | ||
242 | Type | ||
243 | testdata/language-features/adt/gadt01.lc 10:29-10:31 | ||
244 | Type -> String -> Type | ||
245 | testdata/language-features/adt/gadt01.lc 10:29-10:33 | ||
246 | String -> Type | ||
247 | testdata/language-features/adt/gadt01.lc 10:29-10:35 | ||
248 | Type | Type | ||
249 | testdata/language-features/adt/gadt01.lc 10:32-10:33 | ||
250 | Type | ||
251 | testdata/language-features/adt/gadt01.lc 10:34-10:35 | ||
252 | _b | String | ||
253 | testdata/language-features/adt/gadt01.lc 12:6-12:8 | ||
254 | Type -> String -> Type | Type -> String -> Type | Type | Type | ||
255 | -> String -> Type | Type | Type | ||
256 | testdata/language-features/adt/gadt01.lc 12:6-13:35 | ||
257 | Type | Type | ||
258 | testdata/language-features/adt/gadt01.lc 12:15-12:19 | ||
259 | Type | Type | Type | ||
260 | testdata/language-features/adt/gadt01.lc 12:24-12:30 | ||
261 | Type | ||
262 | testdata/language-features/adt/gadt01.lc 12:24-12:38 | ||
263 | Type | ||
264 | testdata/language-features/adt/gadt01.lc 12:34-12:38 | ||
265 | Type | Type | ||
266 | testdata/language-features/adt/gadt01.lc 13:3-13:9 | ||
267 | forall a (b :: String) . a -> M3 a b | M3 _d _b | ||
268 | testdata/language-features/adt/gadt01.lc 13:3-13:35 | ||
269 | Type | Type | Type | ||
270 | testdata/language-features/adt/gadt01.lc 13:13-13:35 | ||
271 | Type | ||
272 | testdata/language-features/adt/gadt01.lc 13:24-13:25 | ||
273 | Type | ||
274 | testdata/language-features/adt/gadt01.lc 13:24-13:35 | ||
275 | Type | ||
276 | testdata/language-features/adt/gadt01.lc 13:29-13:31 | ||
277 | Type -> String -> Type | ||
278 | testdata/language-features/adt/gadt01.lc 13:29-13:33 | ||
279 | String -> Type | ||
280 | testdata/language-features/adt/gadt01.lc 13:29-13:35 | ||
281 | Type | Type | ||
282 | testdata/language-features/adt/gadt01.lc 13:32-13:33 | ||
283 | Type | ||
284 | testdata/language-features/adt/gadt01.lc 13:34-13:35 | ||
285 | _c | String | ||
286 | testdata/language-features/adt/gadt01.lc 17:1-17:2 | ||
287 | forall a (b :: String) . M2 a b -> a | ||
288 | testdata/language-features/adt/gadt01.lc 17:5-17:12 | ||
289 | forall a | ||
290 | . forall (b :: forall (c :: String) -> M2 a c -> Type) | ||
291 | -> (forall (d :: a) -> forall (e :: String) . b e ('Value2 d e)) | ||
292 | -> forall (f :: String) . forall (g :: M2 a f) -> b f g | ||
293 | testdata/language-features/adt/gadt01.lc 17:5-17:24 | ||
294 | (forall (a :: _b) -> @String -> _a) -> forall (b :: String) . M2 _b b -> _a | ||
295 | testdata/language-features/adt/gadt01.lc 17:5-17:37 | ||
296 | forall (a :: String) . M2 _a a -> _a | ||
297 | testdata/language-features/adt/gadt01.lc 17:35-17:36 | ||
298 | _d | ||
299 | testdata/language-features/adt/gadt01.lc 19:1-19:2 | ||
300 | forall a (b :: String) . M3 a b -> a | ||
301 | testdata/language-features/adt/gadt01.lc 19:16-19:17 | ||
302 | _d | ||
303 | testdata/language-features/adt/gadt01.lc 21:11-21:12 | ||
304 | Type -> String -> Type | ||
305 | testdata/language-features/adt/gadt01.lc 21:11-21:17 | ||
306 | String -> Type | ||
307 | testdata/language-features/adt/gadt01.lc 21:11-21:21 | ||
308 | Type | ||
309 | testdata/language-features/adt/gadt01.lc 21:13-21:17 | ||
310 | Type | ||
311 | testdata/language-features/adt/gadt01.lc 21:18-21:21 | ||
312 | String | ||
313 | testdata/language-features/adt/gadt01.lc 22:1-22:7 | ||
314 | M Bool "m" | ||
315 | testdata/language-features/adt/gadt01.lc 22:10-22:15 | ||
316 | forall a . a -> forall (b :: String) . M a b | ||
317 | testdata/language-features/adt/gadt01.lc 22:10-22:20 | ||
318 | forall (a :: String) . M Bool a | ||
319 | testdata/language-features/adt/gadt01.lc 22:16-22:20 | ||
320 | Bool | ||
321 | testdata/language-features/adt/gadt01.lc 24:11-24:13 | ||
322 | Type -> String -> Type | ||
323 | testdata/language-features/adt/gadt01.lc 24:11-24:18 | ||
324 | String -> Type | ||
325 | testdata/language-features/adt/gadt01.lc 24:11-24:22 | ||
326 | Type | ||
327 | testdata/language-features/adt/gadt01.lc 24:14-24:18 | ||
328 | Type | ||
329 | testdata/language-features/adt/gadt01.lc 24:19-24:22 | ||
330 | String | ||
331 | testdata/language-features/adt/gadt01.lc 25:1-25:7 | ||
332 | M2 Bool "s" | ||
333 | testdata/language-features/adt/gadt01.lc 25:10-25:16 | ||
334 | forall a . a -> forall (b :: String) . M2 a b | ||
335 | testdata/language-features/adt/gadt01.lc 25:10-25:21 | ||
336 | forall (a :: String) . M2 Bool a | ||
337 | testdata/language-features/adt/gadt01.lc 25:17-25:21 | ||
338 | Bool | ||
339 | testdata/language-features/adt/gadt01.lc 27:11-27:13 | ||
340 | Type -> String -> Type | ||
341 | testdata/language-features/adt/gadt01.lc 27:11-27:18 | ||
342 | String -> Type | ||
343 | testdata/language-features/adt/gadt01.lc 27:11-27:22 | ||
344 | Type | ||
345 | testdata/language-features/adt/gadt01.lc 27:14-27:18 | ||
346 | Type | ||
347 | testdata/language-features/adt/gadt01.lc 27:19-27:22 | ||
348 | String | ||
349 | testdata/language-features/adt/gadt01.lc 28:1-28:7 | ||
350 | M3 Bool "t" | ||
351 | testdata/language-features/adt/gadt01.lc 28:10-28:16 | ||
352 | forall a (b :: String) . a -> M3 a b | ||
353 | testdata/language-features/adt/gadt01.lc 28:10-28:21 | ||
354 | M3 Bool _a | ||
355 | testdata/language-features/adt/gadt01.lc 28:17-28:21 | ||
356 | Bool | ||
357 | testdata/language-features/adt/gadt01.lc 30:1-30:5 | ||
358 | Bool | ||
359 | testdata/language-features/adt/gadt01.lc 30:8-30:9 | ||
360 | forall a (b :: String) . M2 a b -> a | ||
361 | testdata/language-features/adt/gadt01.lc 30:8-30:16 | ||
362 | Bool | ||
363 | testdata/language-features/adt/gadt01.lc 30:8-30:19 | ||
364 | Bool -> Bool | ||
365 | testdata/language-features/adt/gadt01.lc 30:8-30:28 | ||
366 | Bool | ||
367 | testdata/language-features/adt/gadt01.lc 30:10-30:16 | ||
368 | M2 Bool "s" | ||
369 | testdata/language-features/adt/gadt01.lc 30:17-30:19 | ||
370 | Bool -> Bool -> Bool | ||
371 | testdata/language-features/adt/gadt01.lc 30:20-30:21 | ||
372 | forall a (b :: String) . M3 a b -> a | ||
373 | testdata/language-features/adt/gadt01.lc 30:20-30:28 | ||
374 | Bool | ||
375 | testdata/language-features/adt/gadt01.lc 30:22-30:28 | ||
376 | M3 Bool "t" \ No newline at end of file | ||
diff --git a/testdata/language-features/as-pattern/as-pattern01.lc b/testdata/language-features/as-pattern/as-pattern01.lc index 5bb6c9b0..491a3d50 100644 --- a/testdata/language-features/as-pattern/as-pattern01.lc +++ b/testdata/language-features/as-pattern/as-pattern01.lc | |||
@@ -5,4 +5,4 @@ g x@3 y = x + y | |||
5 | --main has different type as expected | 5 | --main has different type as expected |
6 | --main :: {a} -> {b : 'Num ('MatVecScalarElem a)} -> {c : 'Num a} -> {d:'Int} -> {e : 'Num a}->'Bool | 6 | --main :: {a} -> {b : 'Num ('MatVecScalarElem a)} -> {c : 'Num a} -> {d:'Int} -> {e : 'Num a}->'Bool |
7 | main :: Bool | 7 | main :: Bool |
8 | main = g 3 1 == 5 | 8 | main = g 3 1 == 5 -- TODO: (5 :: Int) |
diff --git a/testdata/language-features/as-pattern/as-pattern01.out b/testdata/language-features/as-pattern/as-pattern01.out index da679416..5b9c82cd 100644 --- a/testdata/language-features/as-pattern/as-pattern01.out +++ b/testdata/language-features/as-pattern/as-pattern01.out | |||
@@ -1,3 +1,98 @@ | |||
1 | testdata/language-features/as-pattern/as-pattern01.lc:8:1: | 1 | main :: forall a . (Eq a, Num (MatVecScalarElem a), Eq a, Num a) => Bool |
2 | main = g 3 1 == 5 | 2 | main = main |
3 | ^^^^ \ No newline at end of file | 3 | ------------ desugared source code |
4 | f | ||
5 | = _lhs | ||
6 | f | ||
7 | \(a :: _) -> case'List | ||
8 | (\(_ :: _) -> _) | ||
9 | (_rhs undefined) | ||
10 | (\(b :: _) (_ :: _) -> _rhs (b : a)) | ||
11 | a | ||
12 | |||
13 | g | ||
14 | = _lhs | ||
15 | g | ||
16 | \(a :: _) (b :: _) -> case'Bool | ||
17 | (\(_ :: _) -> _) | ||
18 | (_rhs undefined) | ||
19 | (_rhs (a + b)) | ||
20 | (fromInt 3 == b) | ||
21 | |||
22 | main :: Bool | ||
23 | main = _lhs main (_rhs (g (fromInt 3) (fromInt 1) == fromInt 5)) | ||
24 | ------------ core code | ||
25 | f :: forall a . [a] -> [a] | ||
26 | f | ||
27 | = \a b -> case'List (\_ -> [a]) (_rhs (undefined [a])) (\c _ -> _rhs (c : b)) b | ||
28 | |||
29 | g :: forall a . (Num (MatVecScalarElem a), Eq a, Num a) => a -> a -> a | ||
30 | g | ||
31 | = \a b c d e f -> case'Bool | ||
32 | (\_ -> a) | ||
33 | (_rhs (undefined a)) | ||
34 | (_rhs (PrimAdd a b e f)) | ||
35 | ((a == c) (fromInt a d 3) f) | ||
36 | |||
37 | main :: forall a . (Eq a, Num (MatVecScalarElem a), Eq a, Num a) => Bool | ||
38 | main | ||
39 | = \a b c d e -> _rhs | ||
40 | ((a == b) (g a c d e (fromInt a e 3) (fromInt a e 1)) (fromInt a e 5)) | ||
41 | ------------ tooltips | ||
42 | testdata/language-features/as-pattern/as-pattern01.lc 1:1-1:2 | ||
43 | forall a . [a] -> [a] | ||
44 | testdata/language-features/as-pattern/as-pattern01.lc 1:14-1:15 | ||
45 | _e | ||
46 | testdata/language-features/as-pattern/as-pattern01.lc 1:14-1:16 | ||
47 | [_d] -> [_d] | ||
48 | testdata/language-features/as-pattern/as-pattern01.lc 1:14-1:17 | ||
49 | [_c] | ||
50 | testdata/language-features/as-pattern/as-pattern01.lc 1:15-1:16 | ||
51 | forall a . a -> [a] -> [a] | ||
52 | testdata/language-features/as-pattern/as-pattern01.lc 1:16-1:17 | ||
53 | _e | ||
54 | testdata/language-features/as-pattern/as-pattern01.lc 3:1-3:2 | ||
55 | forall a . (Num (MatVecScalarElem a), Eq a, Num a) => a -> a -> a | ||
56 | testdata/language-features/as-pattern/as-pattern01.lc 3:11-3:12 | ||
57 | _g | ||
58 | testdata/language-features/as-pattern/as-pattern01.lc 3:11-3:14 | ||
59 | _f -> _f | ||
60 | testdata/language-features/as-pattern/as-pattern01.lc 3:11-3:16 | ||
61 | _d | ||
62 | testdata/language-features/as-pattern/as-pattern01.lc 3:13-3:14 | ||
63 | forall a . Num (MatVecScalarElem a) => a -> a -> a | ||
64 | testdata/language-features/as-pattern/as-pattern01.lc 3:15-3:16 | ||
65 | _c | ||
66 | testdata/language-features/as-pattern/as-pattern01.lc 7:9-7:13 | ||
67 | Type | ||
68 | testdata/language-features/as-pattern/as-pattern01.lc 8:1-8:5 | ||
69 | forall a . (Eq a, Num (MatVecScalarElem a), Eq a, Num a) => Bool | ||
70 | testdata/language-features/as-pattern/as-pattern01.lc 8:8-8:9 | ||
71 | forall a . (Num (MatVecScalarElem a), Eq a, Num a) => a -> a -> a | ||
72 | testdata/language-features/as-pattern/as-pattern01.lc 8:8-8:11 | ||
73 | _e -> _e | ||
74 | testdata/language-features/as-pattern/as-pattern01.lc 8:8-8:13 | ||
75 | _f | ||
76 | testdata/language-features/as-pattern/as-pattern01.lc 8:8-8:16 | ||
77 | _e -> Bool | ||
78 | testdata/language-features/as-pattern/as-pattern01.lc 8:8-8:18 | ||
79 | Bool | ||
80 | testdata/language-features/as-pattern/as-pattern01.lc 8:10-8:11 | ||
81 | _b | ||
82 | testdata/language-features/as-pattern/as-pattern01.lc 8:12-8:13 | ||
83 | _b | ||
84 | testdata/language-features/as-pattern/as-pattern01.lc 8:14-8:16 | ||
85 | forall a . Eq a => a -> a -> Bool | ||
86 | testdata/language-features/as-pattern/as-pattern01.lc 8:17-8:18 | ||
87 | _b | ||
88 | ------------ warnings | ||
89 | Uncovered pattern(s) at testdata/language-features/as-pattern/as-pattern01.lc:1:1: | ||
90 | f y@(x:xs) = x:y | ||
91 | ^ | ||
92 | Missing case(s): | ||
93 | f _ | [] <- _a | ||
94 | Uncovered pattern(s) at testdata/language-features/as-pattern/as-pattern01.lc:3:1: | ||
95 | g x@3 y = x + y | ||
96 | ^ | ||
97 | Missing case(s): | ||
98 | g _ _ | False <- fromInt 3 == _a \ No newline at end of file | ||
diff --git a/testdata/language-features/as-pattern/as-pattern02.out b/testdata/language-features/as-pattern/as-pattern02.out index cb9cee50..8a9f96bc 100644 --- a/testdata/language-features/as-pattern/as-pattern02.out +++ b/testdata/language-features/as-pattern/as-pattern02.out | |||
@@ -1,3 +1,142 @@ | |||
1 | testdata/language-features/as-pattern/as-pattern02.lc:7:1: | 1 | main |
2 | main = f [0,1] == [1] && f [1] == [1] | 2 | :: forall a |
3 | ^^^^ \ No newline at end of file | 3 | . Eq a |
4 | => forall b | ||
5 | . (a ~ [b], Eq b, Num b) | ||
6 | => forall c . Eq c => forall d . (c ~ [d], Eq d, Num d) => Bool | ||
7 | main = main | ||
8 | ------------ desugared source code | ||
9 | f | ||
10 | = _lhs | ||
11 | f | ||
12 | \(a :: _) -> _rhs | ||
13 | ((\(b :: _) -> case'List | ||
14 | (\(_ :: _) -> _) | ||
15 | undefined | ||
16 | (\(c :: _) (d :: _) -> primIfThenElse (c == fromInt 0) d b) | ||
17 | b) | ||
18 | a) | ||
19 | |||
20 | main :: Bool | ||
21 | main | ||
22 | = _lhs | ||
23 | main | ||
24 | (_rhs (f [fromInt 0, fromInt 1] == [fromInt 1] && f [fromInt 1] == [fromInt 1])) | ||
25 | ------------ core code | ||
26 | f :: forall a . (Eq a, Num a) => [a] -> [a] | ||
27 | f | ||
28 | = \a b c d -> _rhs | ||
29 | (case'List | ||
30 | (\_ -> [a]) | ||
31 | (undefined [a]) | ||
32 | (\e f -> primIfThenElse [a] ((a == b) e (fromInt a c 0)) f d) | ||
33 | d) | ||
34 | |||
35 | main | ||
36 | :: forall a | ||
37 | . Eq a | ||
38 | => forall b | ||
39 | . (a ~ [b], Eq b, Num b) | ||
40 | => forall c . Eq c => forall d . (c ~ [d], Eq d, Num d) => Bool | ||
41 | main | ||
42 | = \_ _ a _ b c _ _ d _ e f -> _rhs | ||
43 | (PrimAnd | ||
44 | (undefined | ||
45 | ([a] -> [a] -> 'Bool) | ||
46 | (primIfThenElse | ||
47 | [a] | ||
48 | ((a == b) (fromInt a c 0) (fromInt a c 0)) | ||
49 | [fromInt a c 1] | ||
50 | [fromInt a c 0, fromInt a c 1]) | ||
51 | [fromInt a c 1]) | ||
52 | (undefined | ||
53 | ([d] -> [d] -> 'Bool) | ||
54 | (primIfThenElse | ||
55 | [d] | ||
56 | ((d == e) (fromInt d f 1) (fromInt d f 0)) | ||
57 | [] | ||
58 | [fromInt d f 1]) | ||
59 | [fromInt d f 1])) | ||
60 | ------------ tooltips | ||
61 | testdata/language-features/as-pattern/as-pattern02.lc 3:1-3:2 | ||
62 | forall a . (Eq a, Num a) => [a] -> [a] | ||
63 | testdata/language-features/as-pattern/as-pattern02.lc 3:7-4:49 | ||
64 | [_c] | ||
65 | testdata/language-features/as-pattern/as-pattern02.lc 3:12-3:13 | ||
66 | _e | ||
67 | testdata/language-features/as-pattern/as-pattern02.lc 4:24-4:49 | ||
68 | [_e] | ||
69 | testdata/language-features/as-pattern/as-pattern02.lc 4:27-4:28 | ||
70 | _g | ||
71 | testdata/language-features/as-pattern/as-pattern02.lc 4:27-4:30 | ||
72 | _f -> Bool | ||
73 | testdata/language-features/as-pattern/as-pattern02.lc 4:27-4:31 | ||
74 | Bool | ||
75 | testdata/language-features/as-pattern/as-pattern02.lc 4:27-4:41 | ||
76 | [_f] -> [_f] | ||
77 | testdata/language-features/as-pattern/as-pattern02.lc 4:28-4:30 | ||
78 | forall a . Eq a => a -> a -> Bool | ||
79 | testdata/language-features/as-pattern/as-pattern02.lc 4:30-4:31 | ||
80 | _b | ||
81 | testdata/language-features/as-pattern/as-pattern02.lc 4:37-4:41 | ||
82 | [_g] | ||
83 | testdata/language-features/as-pattern/as-pattern02.lc 4:47-4:49 | ||
84 | _g | ||
85 | testdata/language-features/as-pattern/as-pattern02.lc 6:9-6:13 | ||
86 | Type | ||
87 | testdata/language-features/as-pattern/as-pattern02.lc 7:1-7:5 | ||
88 | forall a | ||
89 | . Eq a | ||
90 | => forall b | ||
91 | . (a ~ [b], Eq b, Num b) | ||
92 | => forall c . Eq c => forall d . (c ~ [d], Eq d, Num d) => Bool | ||
93 | testdata/language-features/as-pattern/as-pattern02.lc 7:8-7:9 | ||
94 | forall a . (Eq a, Num a) => [a] -> [a] | ||
95 | testdata/language-features/as-pattern/as-pattern02.lc 7:8-7:15 | ||
96 | [_d] | ||
97 | testdata/language-features/as-pattern/as-pattern02.lc 7:8-7:18 | ||
98 | [_c] -> Bool | ||
99 | testdata/language-features/as-pattern/as-pattern02.lc 7:8-7:22 | ||
100 | Bool | ||
101 | testdata/language-features/as-pattern/as-pattern02.lc 7:8-7:25 | ||
102 | Bool -> Bool | ||
103 | testdata/language-features/as-pattern/as-pattern02.lc 7:8-7:38 | ||
104 | Bool | ||
105 | testdata/language-features/as-pattern/as-pattern02.lc 7:10-7:15 | ||
106 | [_e] | ||
107 | testdata/language-features/as-pattern/as-pattern02.lc 7:11-7:12 | ||
108 | _b | ||
109 | testdata/language-features/as-pattern/as-pattern02.lc 7:13-7:14 | ||
110 | _b | [_e] | ||
111 | testdata/language-features/as-pattern/as-pattern02.lc 7:16-7:18 | ||
112 | forall a . Eq a => a -> a -> Bool | ||
113 | testdata/language-features/as-pattern/as-pattern02.lc 7:19-7:22 | ||
114 | [_d] | ||
115 | testdata/language-features/as-pattern/as-pattern02.lc 7:20-7:21 | ||
116 | _b | ||
117 | testdata/language-features/as-pattern/as-pattern02.lc 7:23-7:25 | ||
118 | Bool -> Bool -> Bool | ||
119 | testdata/language-features/as-pattern/as-pattern02.lc 7:26-7:27 | ||
120 | forall a . (Eq a, Num a) => [a] -> [a] | ||
121 | testdata/language-features/as-pattern/as-pattern02.lc 7:26-7:31 | ||
122 | [_d] | ||
123 | testdata/language-features/as-pattern/as-pattern02.lc 7:26-7:34 | ||
124 | [_c] -> Bool | ||
125 | testdata/language-features/as-pattern/as-pattern02.lc 7:26-7:38 | ||
126 | Bool | ||
127 | testdata/language-features/as-pattern/as-pattern02.lc 7:28-7:31 | ||
128 | [_d] | ||
129 | testdata/language-features/as-pattern/as-pattern02.lc 7:29-7:30 | ||
130 | _b | ||
131 | testdata/language-features/as-pattern/as-pattern02.lc 7:32-7:34 | ||
132 | forall a . Eq a => a -> a -> Bool | ||
133 | testdata/language-features/as-pattern/as-pattern02.lc 7:35-7:38 | ||
134 | [_d] | ||
135 | testdata/language-features/as-pattern/as-pattern02.lc 7:36-7:37 | ||
136 | _b | ||
137 | ------------ warnings | ||
138 | Uncovered pattern(s) at testdata/language-features/as-pattern/as-pattern02.lc:3:12: | ||
139 | f e = case e of | ||
140 | ^ | ||
141 | Missing case(s): | ||
142 | _ | [] <- _a \ No newline at end of file | ||
diff --git a/testdata/language-features/basic-list/dotdot01.out b/testdata/language-features/basic-list/dotdot01.out index 964cde68..9b85b6a5 100644 --- a/testdata/language-features/basic-list/dotdot01.out +++ b/testdata/language-features/basic-list/dotdot01.out | |||
@@ -1 +1,16 @@ | |||
1 | [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0] \ No newline at end of file | 1 | main :: [Float] |
2 | main = [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0] | ||
3 | ------------ desugared source code | ||
4 | main = _lhs main (_rhs (fromTo (fromInt 1) (fromInt 10))) | ||
5 | ------------ core code | ||
6 | main :: [Float] | ||
7 | main = _rhs [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0] | ||
8 | ------------ tooltips | ||
9 | testdata/language-features/basic-list/dotdot01.lc 2:1-2:5 | ||
10 | [Float] | ||
11 | testdata/language-features/basic-list/dotdot01.lc 2:8-2:15 | ||
12 | [Float] | ||
13 | testdata/language-features/basic-list/dotdot01.lc 2:9-2:10 | ||
14 | _b | ||
15 | testdata/language-features/basic-list/dotdot01.lc 2:12-2:14 | ||
16 | _b \ No newline at end of file | ||
diff --git a/testdata/language-features/pattern/caseWhere.out b/testdata/language-features/pattern/caseWhere.out index 4791ed55..3c090334 100644 --- a/testdata/language-features/pattern/caseWhere.out +++ b/testdata/language-features/pattern/caseWhere.out | |||
@@ -1 +1,31 @@ | |||
1 | True \ No newline at end of file | 1 | main :: Bool |
2 | main = True | ||
3 | ------------ desugared source code | ||
4 | main | ||
5 | = _lhs | ||
6 | main | ||
7 | (_rhs | ||
8 | ((\(a :: _) -> let b = _lhs c (_rhs a) in case'Bool | ||
9 | (\(_ :: _) -> _) | ||
10 | undefined | ||
11 | a | ||
12 | b) | ||
13 | True)) | ||
14 | ------------ core code | ||
15 | main :: Bool | ||
16 | main = _rhs True | ||
17 | ------------ tooltips | ||
18 | testdata/language-features/pattern/caseWhere.lc 4:1-4:5 | ||
19 | Bool | ||
20 | testdata/language-features/pattern/caseWhere.lc 4:8-7:14 | ||
21 | Bool | ||
22 | testdata/language-features/pattern/caseWhere.lc 4:13-4:17 | ||
23 | Bool | ||
24 | testdata/language-features/pattern/caseWhere.lc 5:9-5:10 | ||
25 | _c | ||
26 | testdata/language-features/pattern/caseWhere.lc 5:9-5:15 | ||
27 | Bool | ||
28 | testdata/language-features/pattern/caseWhere.lc 5:14-5:15 | ||
29 | _d | ||
30 | testdata/language-features/pattern/caseWhere.lc 7:13-7:14 | ||
31 | _b \ No newline at end of file | ||
diff --git a/testdata/language-features/pattern/patternGuard.out b/testdata/language-features/pattern/patternGuard.out index 4791ed55..314f4834 100644 --- a/testdata/language-features/pattern/patternGuard.out +++ b/testdata/language-features/pattern/patternGuard.out | |||
@@ -1 +1,49 @@ | |||
1 | True \ No newline at end of file | 1 | main :: Bool |
2 | main = True | ||
3 | ------------ desugared source code | ||
4 | main | ||
5 | = _lhs | ||
6 | main | ||
7 | (_rhs | ||
8 | ((\(a :: _) -> case'Bool | ||
9 | (\(_ :: _) -> _) | ||
10 | (case'Bool | ||
11 | (\(_ :: _) -> _) | ||
12 | undefined | ||
13 | (case'Bool (\(_ :: _) -> _) undefined True True) | ||
14 | a) | ||
15 | undefined | ||
16 | False) | ||
17 | True)) | ||
18 | ------------ core code | ||
19 | main :: Bool | ||
20 | main = _rhs True | ||
21 | ------------ tooltips | ||
22 | testdata/language-features/pattern/patternGuard.lc 4:1-4:5 | ||
23 | Bool | ||
24 | testdata/language-features/pattern/patternGuard.lc 4:8-5:56 | ||
25 | Bool | ||
26 | testdata/language-features/pattern/patternGuard.lc 4:13-4:17 | ||
27 | Bool | ||
28 | testdata/language-features/pattern/patternGuard.lc 5:18-5:23 | ||
29 | Bool | ||
30 | testdata/language-features/pattern/patternGuard.lc 5:18-5:56 | ||
31 | Bool | ||
32 | testdata/language-features/pattern/patternGuard.lc 5:33-5:34 | ||
33 | _b | ||
34 | testdata/language-features/pattern/patternGuard.lc 5:33-5:56 | ||
35 | Bool | ||
36 | testdata/language-features/pattern/patternGuard.lc 5:44-5:48 | ||
37 | Bool | ||
38 | testdata/language-features/pattern/patternGuard.lc 5:44-5:56 | ||
39 | Bool | ||
40 | testdata/language-features/pattern/patternGuard.lc 5:52-5:56 | ||
41 | Bool | ||
42 | ------------ warnings | ||
43 | Uncovered pattern(s) at testdata/language-features/pattern/patternGuard.lc:4:13: | ||
44 | main = case True of | ||
45 | ^^^^ | ||
46 | Missing case(s): | ||
47 | False | False <- False | ||
48 | True | False <- False, False <- True | ||
49 | _ | True <- False \ No newline at end of file | ||
diff --git a/testdata/language-features/pattern/viewPattern.out b/testdata/language-features/pattern/viewPattern.out index 4791ed55..f8fdb6d9 100644 --- a/testdata/language-features/pattern/viewPattern.out +++ b/testdata/language-features/pattern/viewPattern.out | |||
@@ -1 +1,38 @@ | |||
1 | True \ No newline at end of file | 1 | main :: Bool |
2 | main = True | ||
3 | ------------ desugared source code | ||
4 | id = _lhs id \(a :: _) -> _rhs a | ||
5 | |||
6 | main | ||
7 | = _lhs | ||
8 | main | ||
9 | (_rhs ((\(a :: _) -> case'Bool (\(_ :: _) -> _) undefined True (id a)) True)) | ||
10 | ------------ core code | ||
11 | id :: forall a . a -> a | ||
12 | id = \_ a -> _rhs a | ||
13 | |||
14 | main :: Bool | ||
15 | main = _rhs True | ||
16 | ------------ tooltips | ||
17 | testdata/language-features/pattern/viewPattern.lc 4:1-4:3 | ||
18 | forall a . a -> a | ||
19 | testdata/language-features/pattern/viewPattern.lc 4:8-4:9 | ||
20 | _b | ||
21 | testdata/language-features/pattern/viewPattern.lc 6:1-6:5 | ||
22 | Bool | ||
23 | testdata/language-features/pattern/viewPattern.lc 6:8-7:25 | ||
24 | Bool | ||
25 | testdata/language-features/pattern/viewPattern.lc 6:13-6:17 | ||
26 | Bool | ||
27 | testdata/language-features/pattern/viewPattern.lc 7:6-7:8 | ||
28 | forall a . a -> a | _b | ||
29 | testdata/language-features/pattern/viewPattern.lc 7:6-7:25 | ||
30 | Bool | ||
31 | testdata/language-features/pattern/viewPattern.lc 7:21-7:25 | ||
32 | Bool | ||
33 | ------------ warnings | ||
34 | Uncovered pattern(s) at testdata/language-features/pattern/viewPattern.lc:6:13: | ||
35 | main = case True of | ||
36 | ^^^^ | ||
37 | Missing case(s): | ||
38 | _ | False <- id _a \ No newline at end of file | ||
diff --git a/testdata/listcompr01.out b/testdata/listcompr01.out index 4791ed55..0b839ae1 100644 --- a/testdata/listcompr01.out +++ b/testdata/listcompr01.out | |||
@@ -1 +1,93 @@ | |||
1 | True \ No newline at end of file | 1 | main :: Bool |
2 | main = True | ||
3 | ------------ desugared source code | ||
4 | a :: [(Float, Float)] | ||
5 | a | ||
6 | = _lhs | ||
7 | a | ||
8 | (_rhs (concatMap (\(a :: _) -> concatMap (\(b :: _) -> [(a, b)]) [1.0]) [1.0])) | ||
9 | |||
10 | main :: Bool | ||
11 | main | ||
12 | = _lhs | ||
13 | main | ||
14 | (_rhs | ||
15 | ((\(a :: _) -> case'List | ||
16 | (\(_ :: _) -> _) | ||
17 | undefined | ||
18 | (\(b :: _) (c :: _) -> hlistConsCase | ||
19 | _ | ||
20 | (\(d :: _) (e :: _) -> case'Bool | ||
21 | (\(_ :: _) -> _) | ||
22 | undefined | ||
23 | (hlistConsCase | ||
24 | _ | ||
25 | (\(f :: _) (g :: _) -> case'Bool | ||
26 | (\(_ :: _) -> _) | ||
27 | undefined | ||
28 | (hlistNilCase | ||
29 | _ | ||
30 | (case'List (\(_ :: _) -> _) True (\(_ :: _) (_ :: _) -> undefined) c) | ||
31 | g) | ||
32 | (1.0 == f)) | ||
33 | e) | ||
34 | (1.0 == d)) | ||
35 | b) | ||
36 | a) | ||
37 | a)) | ||
38 | ------------ core code | ||
39 | a :: [(Float, Float)] | ||
40 | a = _rhs [(1.0, 1.0)] | ||
41 | |||
42 | main :: Bool | ||
43 | main = _rhs True | ||
44 | ------------ tooltips | ||
45 | testdata/listcompr01.lc 1:6-1:21 | ||
46 | Type | ||
47 | testdata/listcompr01.lc 1:7-1:20 | ||
48 | Type | ||
49 | testdata/listcompr01.lc 1:8-1:13 | ||
50 | Type | ||
51 | testdata/listcompr01.lc 1:8-1:19 | ||
52 | [Type] | ||
53 | testdata/listcompr01.lc 1:14-1:19 | ||
54 | Type | [Type] | ||
55 | testdata/listcompr01.lc 2:1-2:2 | ||
56 | [(Float, Float)] | ||
57 | testdata/listcompr01.lc 2:5-2:35 | ||
58 | [(Float, Float)] | ||
59 | testdata/listcompr01.lc 2:6-2:11 | ||
60 | (_f, _c) | [(_e, _b)] | ||
61 | testdata/listcompr01.lc 2:6-2:34 | ||
62 | [(_b, Float)] | ||
63 | testdata/listcompr01.lc 2:7-2:8 | ||
64 | _i | ||
65 | testdata/listcompr01.lc 2:9-2:10 | ||
66 | _f | ((_c)) | ||
67 | testdata/listcompr01.lc 2:17-2:22 | ||
68 | [Float] | ||
69 | testdata/listcompr01.lc 2:18-2:21 | ||
70 | Float | ||
71 | testdata/listcompr01.lc 2:29-2:34 | ||
72 | [Float] | ||
73 | testdata/listcompr01.lc 2:30-2:33 | ||
74 | Float | ||
75 | testdata/listcompr01.lc 4:9-4:13 | ||
76 | Type | ||
77 | testdata/listcompr01.lc 5:1-5:5 | ||
78 | Bool | ||
79 | testdata/listcompr01.lc 5:8-6:29 | ||
80 | Bool | ||
81 | testdata/listcompr01.lc 5:13-5:14 | ||
82 | [(Float, Float)] | ||
83 | testdata/listcompr01.lc 6:25-6:29 | ||
84 | Bool | Bool | Bool | Bool | Bool | Bool | Bool | ||
85 | ------------ warnings | ||
86 | Uncovered pattern(s) at testdata/listcompr01.lc:5:13: | ||
87 | main = case a of | ||
88 | ^ | ||
89 | Missing case(s): | ||
90 | [] | ||
91 | (HCons _ _ : _) | False <- 1.0 == _b | ||
92 | (HCons _ (HCons _ _) : _) | True <- 1.0 == _b, False <- 1.0 == _b | ||
93 | ((_, _) : _ : _) | True <- 1.0 == _b, True <- 1.0 == _b \ No newline at end of file | ||
diff --git a/testdata/listcompr02.out b/testdata/listcompr02.out index 4791ed55..88460fca 100644 --- a/testdata/listcompr02.out +++ b/testdata/listcompr02.out | |||
@@ -1 +1,205 @@ | |||
1 | True \ No newline at end of file | 1 | main :: Bool |
2 | main = True | ||
3 | ------------ desugared source code | ||
4 | a :: [(Float, Float)] | ||
5 | a | ||
6 | = _lhs | ||
7 | a | ||
8 | (_rhs | ||
9 | (concatMap | ||
10 | (\(a :: _) -> concatMap (\(b :: _) -> [(a *! b, a +! b)]) [1.0, 1.0]) | ||
11 | [1.0, 1.0])) | ||
12 | |||
13 | main :: Bool | ||
14 | main | ||
15 | = _lhs | ||
16 | main | ||
17 | (_rhs | ||
18 | ((\(a :: _) -> case'List | ||
19 | (\(_ :: _) -> _) | ||
20 | undefined | ||
21 | (\(b :: _) (c :: _) -> hlistConsCase | ||
22 | _ | ||
23 | (\(d :: _) (e :: _) -> case'Bool | ||
24 | (\(_ :: _) -> _) | ||
25 | undefined | ||
26 | (hlistConsCase | ||
27 | _ | ||
28 | (\(f :: _) (g :: _) -> case'Bool | ||
29 | (\(_ :: _) -> _) | ||
30 | undefined | ||
31 | (hlistNilCase | ||
32 | _ | ||
33 | (case'List | ||
34 | (\(_ :: _) -> _) | ||
35 | undefined | ||
36 | (\(h :: _) (i :: _) -> hlistConsCase | ||
37 | _ | ||
38 | (\(j :: _) (k :: _) -> case'Bool | ||
39 | (\(_ :: _) -> _) | ||
40 | undefined | ||
41 | (hlistConsCase | ||
42 | _ | ||
43 | (\(l :: _) (m :: _) -> case'Bool | ||
44 | (\(_ :: _) -> _) | ||
45 | undefined | ||
46 | (hlistNilCase | ||
47 | _ | ||
48 | (case'List | ||
49 | (\(_ :: _) -> _) | ||
50 | undefined | ||
51 | (\(n :: _) (o :: _) -> hlistConsCase | ||
52 | _ | ||
53 | (\(p :: _) (q :: _) -> case'Bool | ||
54 | (\(_ :: _) -> _) | ||
55 | undefined | ||
56 | (hlistConsCase | ||
57 | _ | ||
58 | (\(r :: _) (s :: _) -> case'Bool | ||
59 | (\(_ :: _) -> _) | ||
60 | undefined | ||
61 | (hlistNilCase | ||
62 | _ | ||
63 | (case'List | ||
64 | (\(_ :: _) -> _) | ||
65 | undefined | ||
66 | (\(t :: _) (u :: _) -> hlistConsCase | ||
67 | _ | ||
68 | (\(v :: _) (w :: _) -> case'Bool | ||
69 | (\(_ :: _) -> _) | ||
70 | undefined | ||
71 | (hlistConsCase | ||
72 | _ | ||
73 | (\(x :: _) (y :: _) -> case'Bool | ||
74 | (\(_ :: _) -> _) | ||
75 | undefined | ||
76 | (hlistNilCase | ||
77 | _ | ||
78 | (case'List (\(_ :: _) -> _) True (\(_ :: _) (_ :: _) -> undefined) u) | ||
79 | y) | ||
80 | (2.0 == x)) | ||
81 | w) | ||
82 | (1.0 == v)) | ||
83 | t) | ||
84 | o) | ||
85 | s) | ||
86 | (2.0 == r)) | ||
87 | q) | ||
88 | (1.0 == p)) | ||
89 | n) | ||
90 | i) | ||
91 | m) | ||
92 | (2.0 == l)) | ||
93 | k) | ||
94 | (1.0 == j)) | ||
95 | h) | ||
96 | c) | ||
97 | g) | ||
98 | (2.0 == f)) | ||
99 | e) | ||
100 | (1.0 == d)) | ||
101 | b) | ||
102 | a) | ||
103 | a)) | ||
104 | ------------ core code | ||
105 | a :: [(Float, Float)] | ||
106 | a = _rhs [(1.0, 2.0), (1.0, 2.0), (1.0, 2.0), (1.0, 2.0)] | ||
107 | |||
108 | main :: Bool | ||
109 | main = _rhs True | ||
110 | ------------ tooltips | ||
111 | testdata/listcompr02.lc 1:6-1:21 | ||
112 | Type | ||
113 | testdata/listcompr02.lc 1:7-1:20 | ||
114 | Type | ||
115 | testdata/listcompr02.lc 1:8-1:13 | ||
116 | Type | ||
117 | testdata/listcompr02.lc 1:8-1:19 | ||
118 | [Type] | ||
119 | testdata/listcompr02.lc 1:14-1:19 | ||
120 | Type | [Type] | ||
121 | testdata/listcompr02.lc 2:1-2:2 | ||
122 | [(Float, Float)] | ||
123 | testdata/listcompr02.lc 2:5-2:51 | ||
124 | [(Float, Float)] | ||
125 | testdata/listcompr02.lc 2:6-2:17 | ||
126 | (_g, _g) | [(_e, _e)] | ||
127 | testdata/listcompr02.lc 2:6-2:50 | ||
128 | [(_d, _d)] | ||
129 | testdata/listcompr02.lc 2:7-2:8 | ||
130 | _k | ||
131 | testdata/listcompr02.lc 2:7-2:10 | ||
132 | MatVecScalarElem _j -> _j | ||
133 | testdata/listcompr02.lc 2:7-2:11 | ||
134 | _h | ||
135 | testdata/listcompr02.lc 2:8-2:10 | ||
136 | forall a . Num (MatVecScalarElem a) => a -> MatVecScalarElem a -> a | ||
137 | testdata/listcompr02.lc 2:10-2:11 | ||
138 | _f | ||
139 | testdata/listcompr02.lc 2:12-2:13 | ||
140 | _k | ||
141 | testdata/listcompr02.lc 2:12-2:15 | ||
142 | MatVecScalarElem _j -> _j | ||
143 | testdata/listcompr02.lc 2:12-2:16 | ||
144 | _i | ((_g)) | ||
145 | testdata/listcompr02.lc 2:13-2:15 | ||
146 | forall a . Num (MatVecScalarElem a) => a -> MatVecScalarElem a -> a | ||
147 | testdata/listcompr02.lc 2:15-2:16 | ||
148 | MatVecScalarElem _i | ||
149 | testdata/listcompr02.lc 2:23-2:33 | ||
150 | [Float] | ||
151 | testdata/listcompr02.lc 2:24-2:27 | ||
152 | Float | ||
153 | testdata/listcompr02.lc 2:29-2:32 | ||
154 | Float | [Float] | ||
155 | testdata/listcompr02.lc 2:40-2:50 | ||
156 | [Float] | ||
157 | testdata/listcompr02.lc 2:41-2:44 | ||
158 | Float | ||
159 | testdata/listcompr02.lc 2:46-2:49 | ||
160 | Float | [Float] | ||
161 | testdata/listcompr02.lc 4:9-4:13 | ||
162 | Type | ||
163 | testdata/listcompr02.lc 5:1-5:5 | ||
164 | Bool | ||
165 | testdata/listcompr02.lc 5:8-6:59 | ||
166 | Bool | ||
167 | testdata/listcompr02.lc 5:13-5:14 | ||
168 | [(Float, Float)] | ||
169 | testdata/listcompr02.lc 6:55-6:59 | ||
170 | Bool | Bool | Bool | Bool | Bool | Bool | Bool | Bool | Bool | Bool | Bool | Bool | Bool | Bool | Bool | Bool | Bool | Bool | Bool | Bool | Bool | Bool | Bool | Bool | Bool | ||
171 | ------------ warnings | ||
172 | Uncovered pattern(s) at testdata/listcompr02.lc:5:13: | ||
173 | main = case a of | ||
174 | ^ | ||
175 | Missing case(s): | ||
176 | [] | ||
177 | (HCons _ _ : _) | False <- 1.0 == _b | ||
178 | (HCons _ (HCons _ _) : _) | True <- 1.0 == _b, False <- 2.0 == _b | ||
179 | [(_, _)] | True <- 1.0 == _b, True <- 2.0 == _b | ||
180 | ((_, _) : HCons _ _ : _) | ||
181 | | True <- 1.0 == _b, True <- 2.0 == _b, False <- 1.0 == _b | ||
182 | ((_, _) : HCons _ (HCons _ _) : _) | ||
183 | | True <- 1.0 == _b, True <- 2.0 == _b, True <- 1.0 == _b, False <- 2.0 == _b | ||
184 | [(_, _), (_, _)] | ||
185 | | True <- 1.0 == _b, True <- 2.0 == _b, True <- 1.0 == _b, True <- 2.0 == _b | ||
186 | ((_, _) : (_, _) : HCons _ _ : _) | ||
187 | | True <- 1.0 == _b, True <- 2.0 == _b, True <- 1.0 == _b, True | ||
188 | <- 2.0 == _b, False <- 1.0 == _b | ||
189 | ((_, _) : (_, _) : HCons _ (HCons _ _) : _) | ||
190 | | True <- 1.0 == _b, True <- 2.0 == _b, True <- 1.0 == _b, True | ||
191 | <- 2.0 == _b, True <- 1.0 == _b, False <- 2.0 == _b | ||
192 | [(_, _), (_, _), (_, _)] | ||
193 | | True <- 1.0 == _b, True <- 2.0 == _b, True <- 1.0 == _b, True | ||
194 | <- 2.0 == _b, True <- 1.0 == _b, True <- 2.0 == _b | ||
195 | ((_, _) : (_, _) : (_, _) : HCons _ _ : _) | ||
196 | | True <- 1.0 == _b, True <- 2.0 == _b, True <- 1.0 == _b, True | ||
197 | <- 2.0 == _b, True <- 1.0 == _b, True <- 2.0 == _b, False <- 1.0 == _b | ||
198 | ((_, _) : (_, _) : (_, _) : HCons _ (HCons _ _) : _) | ||
199 | | True <- 1.0 == _b, True <- 2.0 == _b, True <- 1.0 == _b, True | ||
200 | <- 2.0 == _b, True <- 1.0 == _b, True <- 2.0 == _b, True <- 1.0 == _b, False | ||
201 | <- 2.0 == _b | ||
202 | ((_, _) : (_, _) : (_, _) : (_, _) : _ : _) | ||
203 | | True <- 1.0 == _b, True <- 2.0 == _b, True <- 1.0 == _b, True | ||
204 | <- 2.0 == _b, True <- 1.0 == _b, True <- 2.0 == _b, True <- 1.0 == _b, True | ||
205 | <- 2.0 == _b \ No newline at end of file | ||
diff --git a/testdata/listcompr03.out b/testdata/listcompr03.out index 4791ed55..9a33c1ea 100644 --- a/testdata/listcompr03.out +++ b/testdata/listcompr03.out | |||
@@ -1 +1,215 @@ | |||
1 | True \ No newline at end of file | 1 | main :: Bool |
2 | main = True | ||
3 | ------------ desugared source code | ||
4 | a :: [(Float, Float)] | ||
5 | a | ||
6 | = _lhs | ||
7 | a | ||
8 | (_rhs | ||
9 | let a = _lhs _k (_rhs 1.0); b = _lhs k (_rhs ((\(c :: _) -> c) a)) in concatMap | ||
10 | (\(d :: _) -> concatMap (\(e :: _) -> [(b *! d *! e, d +! e)]) [1.0, 1.0]) | ||
11 | [1.0, b]) | ||
12 | |||
13 | main :: Bool | ||
14 | main | ||
15 | = _lhs | ||
16 | main | ||
17 | (_rhs | ||
18 | ((\(a :: _) -> case'List | ||
19 | (\(_ :: _) -> _) | ||
20 | undefined | ||
21 | (\(b :: _) (c :: _) -> hlistConsCase | ||
22 | _ | ||
23 | (\(d :: _) (e :: _) -> case'Bool | ||
24 | (\(_ :: _) -> _) | ||
25 | undefined | ||
26 | (hlistConsCase | ||
27 | _ | ||
28 | (\(f :: _) (g :: _) -> case'Bool | ||
29 | (\(_ :: _) -> _) | ||
30 | undefined | ||
31 | (hlistNilCase | ||
32 | _ | ||
33 | (case'List | ||
34 | (\(_ :: _) -> _) | ||
35 | undefined | ||
36 | (\(h :: _) (i :: _) -> hlistConsCase | ||
37 | _ | ||
38 | (\(j :: _) (k :: _) -> case'Bool | ||
39 | (\(_ :: _) -> _) | ||
40 | undefined | ||
41 | (hlistConsCase | ||
42 | _ | ||
43 | (\(l :: _) (m :: _) -> case'Bool | ||
44 | (\(_ :: _) -> _) | ||
45 | undefined | ||
46 | (hlistNilCase | ||
47 | _ | ||
48 | (case'List | ||
49 | (\(_ :: _) -> _) | ||
50 | undefined | ||
51 | (\(n :: _) (o :: _) -> hlistConsCase | ||
52 | _ | ||
53 | (\(p :: _) (q :: _) -> case'Bool | ||
54 | (\(_ :: _) -> _) | ||
55 | undefined | ||
56 | (hlistConsCase | ||
57 | _ | ||
58 | (\(r :: _) (s :: _) -> case'Bool | ||
59 | (\(_ :: _) -> _) | ||
60 | undefined | ||
61 | (hlistNilCase | ||
62 | _ | ||
63 | (case'List | ||
64 | (\(_ :: _) -> _) | ||
65 | undefined | ||
66 | (\(t :: _) (u :: _) -> hlistConsCase | ||
67 | _ | ||
68 | (\(v :: _) (w :: _) -> case'Bool | ||
69 | (\(_ :: _) -> _) | ||
70 | undefined | ||
71 | (hlistConsCase | ||
72 | _ | ||
73 | (\(x :: _) (y :: _) -> case'Bool | ||
74 | (\(_ :: _) -> _) | ||
75 | undefined | ||
76 | (hlistNilCase | ||
77 | _ | ||
78 | (case'List (\(_ :: _) -> _) True (\(_ :: _) (_ :: _) -> undefined) u) | ||
79 | y) | ||
80 | (2.0 == x)) | ||
81 | w) | ||
82 | (1.0 == v)) | ||
83 | t) | ||
84 | o) | ||
85 | s) | ||
86 | (2.0 == r)) | ||
87 | q) | ||
88 | (1.0 == p)) | ||
89 | n) | ||
90 | i) | ||
91 | m) | ||
92 | (2.0 == l)) | ||
93 | k) | ||
94 | (1.0 == j)) | ||
95 | h) | ||
96 | c) | ||
97 | g) | ||
98 | (2.0 == f)) | ||
99 | e) | ||
100 | (1.0 == d)) | ||
101 | b) | ||
102 | a) | ||
103 | a)) | ||
104 | ------------ core code | ||
105 | a :: [(Float, Float)] | ||
106 | a = _rhs [(1.0, 2.0), (1.0, 2.0), (1.0, 2.0), (1.0, 2.0)] | ||
107 | |||
108 | main :: Bool | ||
109 | main = _rhs True | ||
110 | ------------ tooltips | ||
111 | testdata/listcompr03.lc 1:6-1:21 | ||
112 | Type | ||
113 | testdata/listcompr03.lc 1:7-1:20 | ||
114 | Type | ||
115 | testdata/listcompr03.lc 1:8-1:13 | ||
116 | Type | ||
117 | testdata/listcompr03.lc 1:8-1:19 | ||
118 | [Type] | ||
119 | testdata/listcompr03.lc 1:14-1:19 | ||
120 | Type | [Type] | ||
121 | testdata/listcompr03.lc 2:1-2:2 | ||
122 | [(Float, Float)] | ||
123 | testdata/listcompr03.lc 2:6-2:20 | ||
124 | (Float, Float) | [(Float, Float)] | ||
125 | testdata/listcompr03.lc 2:6-2:63 | ||
126 | [(Float, Float)] | ||
127 | testdata/listcompr03.lc 2:7-2:8 | ||
128 | Float | ||
129 | testdata/listcompr03.lc 2:7-2:10 | ||
130 | MatVecScalarElem Float -> Float | ||
131 | testdata/listcompr03.lc 2:7-2:11 | ||
132 | Float | ||
133 | testdata/listcompr03.lc 2:7-2:13 | ||
134 | MatVecScalarElem Float -> Float | ||
135 | testdata/listcompr03.lc 2:7-2:14 | ||
136 | Float | ||
137 | testdata/listcompr03.lc 2:8-2:10 | ||
138 | forall a . Num (MatVecScalarElem a) => a -> MatVecScalarElem a -> a | ||
139 | testdata/listcompr03.lc 2:10-2:11 | ||
140 | _j | ||
141 | testdata/listcompr03.lc 2:11-2:13 | ||
142 | forall a . Num (MatVecScalarElem a) => a -> MatVecScalarElem a -> a | ||
143 | testdata/listcompr03.lc 2:13-2:14 | ||
144 | _e | ||
145 | testdata/listcompr03.lc 2:15-2:16 | ||
146 | Float | ||
147 | testdata/listcompr03.lc 2:15-2:18 | ||
148 | MatVecScalarElem Float -> Float | ||
149 | testdata/listcompr03.lc 2:15-2:19 | ||
150 | Float | ((Float)) | ||
151 | testdata/listcompr03.lc 2:16-2:18 | ||
152 | forall a . Num (MatVecScalarElem a) => a -> MatVecScalarElem a -> a | ||
153 | testdata/listcompr03.lc 2:18-2:19 | ||
154 | Float | ||
155 | testdata/listcompr03.lc 2:25-2:26 | ||
156 | _b | Float | ||
157 | testdata/listcompr03.lc 2:29-2:32 | ||
158 | Float | ||
159 | testdata/listcompr03.lc 2:38-2:46 | ||
160 | [Float] | ||
161 | testdata/listcompr03.lc 2:39-2:42 | ||
162 | Float | ||
163 | testdata/listcompr03.lc 2:44-2:45 | ||
164 | Float | [Float] | ||
165 | testdata/listcompr03.lc 2:53-2:63 | ||
166 | [Float] | ||
167 | testdata/listcompr03.lc 2:54-2:57 | ||
168 | Float | ||
169 | testdata/listcompr03.lc 2:59-2:62 | ||
170 | Float | [Float] | ||
171 | testdata/listcompr03.lc 4:9-4:13 | ||
172 | Type | ||
173 | testdata/listcompr03.lc 5:1-5:5 | ||
174 | Bool | ||
175 | testdata/listcompr03.lc 5:8-6:59 | ||
176 | Bool | ||
177 | testdata/listcompr03.lc 5:13-5:14 | ||
178 | [(Float, Float)] | ||
179 | testdata/listcompr03.lc 6:55-6:59 | ||
180 | Bool | Bool | Bool | Bool | Bool | Bool | Bool | Bool | Bool | Bool | Bool | Bool | Bool | Bool | Bool | Bool | Bool | Bool | Bool | Bool | Bool | Bool | Bool | Bool | Bool | ||
181 | ------------ warnings | ||
182 | Uncovered pattern(s) at testdata/listcompr03.lc:5:13: | ||
183 | main = case a of | ||
184 | ^ | ||
185 | Missing case(s): | ||
186 | [] | ||
187 | (HCons _ _ : _) | False <- 1.0 == _b | ||
188 | (HCons _ (HCons _ _) : _) | True <- 1.0 == _b, False <- 2.0 == _b | ||
189 | [(_, _)] | True <- 1.0 == _b, True <- 2.0 == _b | ||
190 | ((_, _) : HCons _ _ : _) | ||
191 | | True <- 1.0 == _b, True <- 2.0 == _b, False <- 1.0 == _b | ||
192 | ((_, _) : HCons _ (HCons _ _) : _) | ||
193 | | True <- 1.0 == _b, True <- 2.0 == _b, True <- 1.0 == _b, False <- 2.0 == _b | ||
194 | [(_, _), (_, _)] | ||
195 | | True <- 1.0 == _b, True <- 2.0 == _b, True <- 1.0 == _b, True <- 2.0 == _b | ||
196 | ((_, _) : (_, _) : HCons _ _ : _) | ||
197 | | True <- 1.0 == _b, True <- 2.0 == _b, True <- 1.0 == _b, True | ||
198 | <- 2.0 == _b, False <- 1.0 == _b | ||
199 | ((_, _) : (_, _) : HCons _ (HCons _ _) : _) | ||
200 | | True <- 1.0 == _b, True <- 2.0 == _b, True <- 1.0 == _b, True | ||
201 | <- 2.0 == _b, True <- 1.0 == _b, False <- 2.0 == _b | ||
202 | [(_, _), (_, _), (_, _)] | ||
203 | | True <- 1.0 == _b, True <- 2.0 == _b, True <- 1.0 == _b, True | ||
204 | <- 2.0 == _b, True <- 1.0 == _b, True <- 2.0 == _b | ||
205 | ((_, _) : (_, _) : (_, _) : HCons _ _ : _) | ||
206 | | True <- 1.0 == _b, True <- 2.0 == _b, True <- 1.0 == _b, True | ||
207 | <- 2.0 == _b, True <- 1.0 == _b, True <- 2.0 == _b, False <- 1.0 == _b | ||
208 | ((_, _) : (_, _) : (_, _) : HCons _ (HCons _ _) : _) | ||
209 | | True <- 1.0 == _b, True <- 2.0 == _b, True <- 1.0 == _b, True | ||
210 | <- 2.0 == _b, True <- 1.0 == _b, True <- 2.0 == _b, True <- 1.0 == _b, False | ||
211 | <- 2.0 == _b | ||
212 | ((_, _) : (_, _) : (_, _) : (_, _) : _ : _) | ||
213 | | True <- 1.0 == _b, True <- 2.0 == _b, True <- 1.0 == _b, True | ||
214 | <- 2.0 == _b, True <- 1.0 == _b, True <- 2.0 == _b, True <- 1.0 == _b, True | ||
215 | <- 2.0 == _b \ No newline at end of file | ||
diff --git a/testdata/listcompr04.out b/testdata/listcompr04.out index 4791ed55..db27d5d9 100644 --- a/testdata/listcompr04.out +++ b/testdata/listcompr04.out | |||
@@ -1 +1,90 @@ | |||
1 | True \ No newline at end of file | 1 | main :: Bool |
2 | main = True | ||
3 | ------------ desugared source code | ||
4 | a :: [Float] | ||
5 | a | ||
6 | = _lhs | ||
7 | a | ||
8 | (_rhs | ||
9 | let a = _lhs _k (_rhs 2.0); b = _lhs k (_rhs ((\(c :: _) -> c) a)) in concatMap | ||
10 | (\(d :: _) -> [d *! b]) | ||
11 | [1.0, b]) | ||
12 | |||
13 | main :: Bool | ||
14 | main | ||
15 | = _lhs | ||
16 | main | ||
17 | (_rhs | ||
18 | ((\(a :: _) -> case'List | ||
19 | (\(_ :: _) -> _) | ||
20 | undefined | ||
21 | (\(b :: _) (c :: _) -> case'Bool | ||
22 | (\(_ :: _) -> _) | ||
23 | undefined | ||
24 | (case'List | ||
25 | (\(_ :: _) -> _) | ||
26 | undefined | ||
27 | (\(d :: _) (e :: _) -> case'Bool | ||
28 | (\(_ :: _) -> _) | ||
29 | undefined | ||
30 | (case'List (\(_ :: _) -> _) True (\(_ :: _) (_ :: _) -> undefined) e) | ||
31 | (4.0 == d)) | ||
32 | c) | ||
33 | (2.0 == b)) | ||
34 | a) | ||
35 | a)) | ||
36 | ------------ core code | ||
37 | a :: [Float] | ||
38 | a = _rhs [2.0, 4.0] | ||
39 | |||
40 | main :: Bool | ||
41 | main = _rhs True | ||
42 | ------------ tooltips | ||
43 | testdata/listcompr04.lc 1:6-1:13 | ||
44 | Type | ||
45 | testdata/listcompr04.lc 1:7-1:12 | ||
46 | Type | ||
47 | testdata/listcompr04.lc 2:1-2:2 | ||
48 | [Float] | ||
49 | testdata/listcompr04.lc 2:6-2:7 | ||
50 | _f | ||
51 | testdata/listcompr04.lc 2:6-2:9 | ||
52 | MatVecScalarElem _e -> _e | ||
53 | testdata/listcompr04.lc 2:6-2:10 | ||
54 | _e | [_d] | ||
55 | testdata/listcompr04.lc 2:6-2:36 | ||
56 | [Float] | ||
57 | testdata/listcompr04.lc 2:7-2:9 | ||
58 | forall a . Num (MatVecScalarElem a) => a -> MatVecScalarElem a -> a | ||
59 | testdata/listcompr04.lc 2:9-2:10 | ||
60 | Float | ||
61 | testdata/listcompr04.lc 2:15-2:16 | ||
62 | _b | Float | ||
63 | testdata/listcompr04.lc 2:19-2:22 | ||
64 | Float | ||
65 | testdata/listcompr04.lc 2:28-2:36 | ||
66 | [Float] | ||
67 | testdata/listcompr04.lc 2:29-2:32 | ||
68 | Float | ||
69 | testdata/listcompr04.lc 2:34-2:35 | ||
70 | Float | [Float] | ||
71 | testdata/listcompr04.lc 4:9-4:13 | ||
72 | Type | ||
73 | testdata/listcompr04.lc 5:1-5:5 | ||
74 | Bool | ||
75 | testdata/listcompr04.lc 5:8-6:28 | ||
76 | Bool | ||
77 | testdata/listcompr04.lc 5:13-5:14 | ||
78 | [Float] | ||
79 | testdata/listcompr04.lc 6:24-6:28 | ||
80 | Bool | Bool | Bool | Bool | Bool | ||
81 | ------------ warnings | ||
82 | Uncovered pattern(s) at testdata/listcompr04.lc:5:13: | ||
83 | main = case a of | ||
84 | ^ | ||
85 | Missing case(s): | ||
86 | [] | ||
87 | (_ : _) | False <- 2.0 == _b | ||
88 | [_] | True <- 2.0 == _b | ||
89 | (_ : _ : _) | True <- 2.0 == _b, False <- 4.0 == _b | ||
90 | (_ : _ : _ : _) | True <- 2.0 == _b, True <- 4.0 == _b \ No newline at end of file | ||
diff --git a/testdata/listcompr05.out b/testdata/listcompr05.out index 4791ed55..0e6445e3 100644 --- a/testdata/listcompr05.out +++ b/testdata/listcompr05.out | |||
@@ -1 +1,128 @@ | |||
1 | True \ No newline at end of file | 1 | main :: Bool |
2 | main = True | ||
3 | ------------ desugared source code | ||
4 | isZero :: Float -> Bool | ||
5 | isZero | ||
6 | = _lhs | ||
7 | isZero | ||
8 | \(a :: _) -> case'Bool (\(_ :: _) -> _) (_rhs False) (_rhs True) (0.0 == a) | ||
9 | |||
10 | a :: [Float] | ||
11 | a | ||
12 | = _lhs | ||
13 | a | ||
14 | (_rhs | ||
15 | (concatMap | ||
16 | (\(a :: _) -> concatMap | ||
17 | (\(b :: _) -> primIfThenElse (isZero a) [a *! b] []) | ||
18 | [1.0, 2.0]) | ||
19 | [0.0, 2.0])) | ||
20 | |||
21 | main :: Bool | ||
22 | main | ||
23 | = _lhs | ||
24 | main | ||
25 | (_rhs | ||
26 | ((\(a :: _) -> case'List | ||
27 | (\(_ :: _) -> _) | ||
28 | undefined | ||
29 | (\(b :: _) (c :: _) -> case'Bool | ||
30 | (\(_ :: _) -> _) | ||
31 | undefined | ||
32 | (case'List | ||
33 | (\(_ :: _) -> _) | ||
34 | undefined | ||
35 | (\(d :: _) (e :: _) -> case'Bool | ||
36 | (\(_ :: _) -> _) | ||
37 | undefined | ||
38 | (case'List (\(_ :: _) -> _) True (\(_ :: _) (_ :: _) -> undefined) e) | ||
39 | (0.0 == d)) | ||
40 | c) | ||
41 | (0.0 == b)) | ||
42 | a) | ||
43 | a)) | ||
44 | ------------ core code | ||
45 | a :: [Float] | ||
46 | a = _rhs [0.0, 0.0] | ||
47 | |||
48 | isZero :: Float -> Bool | ||
49 | isZero | ||
50 | = \a -> case'Bool | ||
51 | (\_ -> 'Bool) | ||
52 | (_rhs False) | ||
53 | (_rhs True) | ||
54 | (isEQ (primCompareFloat 0.0 a)) | ||
55 | |||
56 | main :: Bool | ||
57 | main = _rhs True | ||
58 | ------------ tooltips | ||
59 | testdata/listcompr05.lc 1:11-1:16 | ||
60 | Type | ||
61 | testdata/listcompr05.lc 1:20-1:24 | ||
62 | Type | Type | ||
63 | testdata/listcompr05.lc 2:1-2:7 | ||
64 | Float -> Bool | ||
65 | testdata/listcompr05.lc 2:14-2:18 | ||
66 | Bool | ||
67 | testdata/listcompr05.lc 2:14-3:17 | ||
68 | Bool -> Bool | Bool | ||
69 | testdata/listcompr05.lc 3:12-3:17 | ||
70 | Bool | ||
71 | testdata/listcompr05.lc 5:6-5:13 | ||
72 | Type | ||
73 | testdata/listcompr05.lc 5:7-5:12 | ||
74 | Type | ||
75 | testdata/listcompr05.lc 6:1-6:2 | ||
76 | [Float] | ||
77 | testdata/listcompr05.lc 6:5-6:51 | ||
78 | [Float] | ||
79 | testdata/listcompr05.lc 6:6-6:7 | ||
80 | Float | ||
81 | testdata/listcompr05.lc 6:6-6:9 | ||
82 | MatVecScalarElem Float -> Float | ||
83 | testdata/listcompr05.lc 6:6-6:10 | ||
84 | Float | [Float] | ||
85 | testdata/listcompr05.lc 6:6-6:50 | ||
86 | [Float] -> [Float] | [Float] | [Float] | ||
87 | testdata/listcompr05.lc 6:7-6:9 | ||
88 | forall a . Num (MatVecScalarElem a) => a -> MatVecScalarElem a -> a | ||
89 | testdata/listcompr05.lc 6:9-6:10 | ||
90 | _d | ||
91 | testdata/listcompr05.lc 6:16-6:25 | ||
92 | [Float] | ||
93 | testdata/listcompr05.lc 6:17-6:20 | ||
94 | Float | ||
95 | testdata/listcompr05.lc 6:21-6:24 | ||
96 | Float | [Float] | ||
97 | testdata/listcompr05.lc 6:32-6:41 | ||
98 | [Float] | ||
99 | testdata/listcompr05.lc 6:33-6:36 | ||
100 | Float | ||
101 | testdata/listcompr05.lc 6:37-6:40 | ||
102 | Float | [Float] | ||
103 | testdata/listcompr05.lc 6:42-6:48 | ||
104 | Float -> Bool | ||
105 | testdata/listcompr05.lc 6:42-6:50 | ||
106 | Bool | ||
107 | testdata/listcompr05.lc 6:49-6:50 | ||
108 | _g | ||
109 | testdata/listcompr05.lc 8:9-8:13 | ||
110 | Type | ||
111 | testdata/listcompr05.lc 9:1-9:5 | ||
112 | Bool | ||
113 | testdata/listcompr05.lc 9:8-10:27 | ||
114 | Bool | ||
115 | testdata/listcompr05.lc 9:13-9:14 | ||
116 | [Float] | ||
117 | testdata/listcompr05.lc 10:23-10:27 | ||
118 | Bool | Bool | Bool | Bool | Bool | ||
119 | ------------ warnings | ||
120 | Uncovered pattern(s) at testdata/listcompr05.lc:9:13: | ||
121 | main = case a of | ||
122 | ^ | ||
123 | Missing case(s): | ||
124 | [] | ||
125 | (_ : _) | False <- 0.0 == _b | ||
126 | [_] | True <- 0.0 == _b | ||
127 | (_ : _ : _) | True <- 0.0 == _b, False <- 0.0 == _b | ||
128 | (_ : _ : _ : _) | True <- 0.0 == _b, True <- 0.0 == _b \ No newline at end of file | ||
diff --git a/testdata/localfun.out b/testdata/localfun.out index 4791ed55..bf1b11b3 100644 --- a/testdata/localfun.out +++ b/testdata/localfun.out | |||
@@ -1 +1,61 @@ | |||
1 | True \ No newline at end of file | 1 | main :: Bool |
2 | main = True | ||
3 | ------------ desugared source code | ||
4 | f | ||
5 | = _lhs | ||
6 | f | ||
7 | \(a :: _) (b :: _) -> _rhs | ||
8 | let | ||
9 | c = _lhs g \(d :: _) -> case'Bool (\(_ :: _) -> _) (_rhs b) (_rhs True) d | ||
10 | in c a | ||
11 | |||
12 | main = _lhs main (_rhs (f True False && f False True)) | ||
13 | ------------ core code | ||
14 | f :: Bool -> Bool -> Bool | ||
15 | f = \a b -> _rhs (g b a) | ||
16 | |||
17 | main :: Bool | ||
18 | main = _rhs True | ||
19 | ------------ tooltips | ||
20 | testdata/localfun.lc 3:1-3:2 | ||
21 | Bool -> Bool -> Bool | ||
22 | testdata/localfun.lc 3:9-3:10 | ||
23 | Bool -> Bool | ||
24 | testdata/localfun.lc 3:9-3:12 | ||
25 | Bool | ||
26 | testdata/localfun.lc 3:11-3:12 | ||
27 | _d | ||
28 | testdata/localfun.lc 5:14-5:18 | ||
29 | Bool | ||
30 | testdata/localfun.lc 5:14-6:16 | ||
31 | Bool -> Bool | ||
32 | testdata/localfun.lc 6:15-6:16 | ||
33 | _e | ||
34 | testdata/localfun.lc 8:1-8:5 | ||
35 | Bool | ||
36 | testdata/localfun.lc 8:8-8:9 | ||
37 | Bool -> Bool -> Bool | ||
38 | testdata/localfun.lc 8:8-8:14 | ||
39 | Bool -> Bool | ||
40 | testdata/localfun.lc 8:8-8:20 | ||
41 | Bool | ||
42 | testdata/localfun.lc 8:8-8:23 | ||
43 | Bool -> Bool | ||
44 | testdata/localfun.lc 8:8-8:36 | ||
45 | Bool | ||
46 | testdata/localfun.lc 8:10-8:14 | ||
47 | Bool | ||
48 | testdata/localfun.lc 8:15-8:20 | ||
49 | Bool | ||
50 | testdata/localfun.lc 8:21-8:23 | ||
51 | Bool -> Bool -> Bool | ||
52 | testdata/localfun.lc 8:24-8:25 | ||
53 | Bool -> Bool -> Bool | ||
54 | testdata/localfun.lc 8:24-8:31 | ||
55 | Bool -> Bool | ||
56 | testdata/localfun.lc 8:24-8:36 | ||
57 | Bool | ||
58 | testdata/localfun.lc 8:26-8:31 | ||
59 | Bool | ||
60 | testdata/localfun.lc 8:32-8:36 | ||
61 | Bool \ No newline at end of file | ||
diff --git a/testdata/record02.out b/testdata/record02.out index 4791ed55..ce80a224 100644 --- a/testdata/record02.out +++ b/testdata/record02.out | |||
@@ -1 +1,385 @@ | |||
1 | True \ No newline at end of file | 1 | main :: Bool |
2 | main = True | ||
3 | ------------ desugared source code | ||
4 | v1 = _lhs v1 (_rhs (RecordCons @[RecItem "x" _, RecItem "y" _] (1.0, 0.0))) | ||
5 | |||
6 | v2 | ||
7 | = _lhs | ||
8 | v2 | ||
9 | (_rhs | ||
10 | (RecordCons @[RecItem "x" _, RecItem "y" _, RecItem "z" _] (1.0, 0.0, 10.0))) | ||
11 | |||
12 | v3 = _lhs v3 (_rhs (RecordCons @[RecItem "v1" _, RecItem "v2" _] (v1, v2))) | ||
13 | |||
14 | f = _lhs f \(a :: _) -> _rhs (project "x" a +! project "y" a) | ||
15 | |||
16 | g | ||
17 | = _lhs | ||
18 | g | ||
19 | \(a :: _) -> _rhs (project "x" (project "v1" a) +! project "z" (project "v2" a)) | ||
20 | |||
21 | x = _lhs x \(a :: _) -> _rhs (project "x" (a v3)) | ||
22 | |||
23 | z = _lhs z \(a :: _) -> _rhs (project "v" (project "c" (project "x" (a v3)))) | ||
24 | |||
25 | main | ||
26 | = _lhs | ||
27 | main | ||
28 | (_rhs | ||
29 | ((\(a :: _) -> case'Bool (\(_ :: _) -> _) False True (13.0 == a)) | ||
30 | (f v1 +! f v2 +! g v3))) | ||
31 | ------------ core code | ||
32 | f | ||
33 | :: forall a | ||
34 | . Num (MatVecScalarElem a) | ||
35 | => forall (b :: [RecItem]) | ||
36 | . (isKeyC "x" a b, isKeyC "y" (MatVecScalarElem a) b) => RecordC b -> a | ||
37 | f | ||
38 | = \a b c d e f -> _rhs | ||
39 | (PrimAddS | ||
40 | ('MatVecScalarElem a) | ||
41 | a | ||
42 | TT | ||
43 | b | ||
44 | (project a c "x" d f) | ||
45 | (project ('MatVecScalarElem a) c "y" e f)) | ||
46 | |||
47 | g | ||
48 | :: forall a | ||
49 | . Num (MatVecScalarElem a) | ||
50 | => forall (b :: [RecItem]) | ||
51 | . isKeyC "x" a b | ||
52 | => forall (c :: [RecItem]) | ||
53 | . isKeyC "v1" (RecordC b) c | ||
54 | => forall (d :: [RecItem]) | ||
55 | . (isKeyC "z" (MatVecScalarElem a) d, isKeyC "v2" (RecordC d) c) | ||
56 | => RecordC c -> a | ||
57 | g | ||
58 | = \a b c d e f g h i j -> _rhs | ||
59 | (PrimAddS | ||
60 | ('MatVecScalarElem a) | ||
61 | a | ||
62 | TT | ||
63 | b | ||
64 | (project a c "x" d (project ('RecordC c) e "v1" f j)) | ||
65 | (project ('MatVecScalarElem a) g "z" h (project ('RecordC g) e "v2" i j))) | ||
66 | |||
67 | main :: Bool | ||
68 | main = _rhs True | ||
69 | |||
70 | v1 :: RecordC ' ['RecItem "x" Float, 'RecItem "y" Float] | ||
71 | v1 = _rhs (RecordCons (1.0, 0.0)) | ||
72 | |||
73 | v2 :: RecordC ' ['RecItem "x" Float, 'RecItem "y" Float, 'RecItem "z" Float] | ||
74 | v2 = _rhs (RecordCons (1.0, 0.0, 10.0)) | ||
75 | |||
76 | v3 | ||
77 | :: RecordC | ||
78 | ' ['RecItem "v1" (RecordC ' ['RecItem "x" Float, 'RecItem "y" Float]) | ||
79 | , 'RecItem | ||
80 | "v2" | ||
81 | (RecordC ' ['RecItem "x" Float, 'RecItem "y" Float, 'RecItem "z" Float])] | ||
82 | v3 = _rhs (RecordCons (RecordCons (1.0, 0.0), RecordCons (1.0, 0.0, 10.0))) | ||
83 | |||
84 | x | ||
85 | :: forall a (b :: [RecItem]) | ||
86 | . isKeyC "x" a b | ||
87 | => (RecordC | ||
88 | ' ['RecItem "v1" (RecordC ' ['RecItem "x" Float, 'RecItem "y" Float]) | ||
89 | , 'RecItem | ||
90 | "v2" | ||
91 | (RecordC ' ['RecItem "x" Float, 'RecItem "y" Float, 'RecItem "z" Float])] | ||
92 | -> RecordC b) | ||
93 | -> a | ||
94 | x | ||
95 | = \a b c d -> _rhs | ||
96 | (project | ||
97 | a | ||
98 | b | ||
99 | "x" | ||
100 | c | ||
101 | (d (RecordCons (RecordCons (1.0, 0.0), RecordCons (1.0, 0.0, 10.0))))) | ||
102 | |||
103 | z | ||
104 | :: forall a (b :: [RecItem]) | ||
105 | . isKeyC "v" a b | ||
106 | => forall (c :: [RecItem]) | ||
107 | . isKeyC "c" (RecordC b) c | ||
108 | => forall (d :: [RecItem]) | ||
109 | . isKeyC "x" (RecordC c) d | ||
110 | => (RecordC | ||
111 | ' ['RecItem "v1" (RecordC ' ['RecItem "x" Float, 'RecItem "y" Float]) | ||
112 | , 'RecItem | ||
113 | "v2" | ||
114 | (RecordC ' ['RecItem "x" Float, 'RecItem "y" Float, 'RecItem "z" Float])] | ||
115 | -> RecordC d) | ||
116 | -> a | ||
117 | z | ||
118 | = \a b c d e f g h -> _rhs | ||
119 | (project | ||
120 | a | ||
121 | b | ||
122 | "v" | ||
123 | c | ||
124 | (project | ||
125 | ('RecordC b) | ||
126 | d | ||
127 | "c" | ||
128 | e | ||
129 | (project | ||
130 | ('RecordC d) | ||
131 | f | ||
132 | "x" | ||
133 | g | ||
134 | (h (RecordCons (RecordCons (1.0, 0.0), RecordCons (1.0, 0.0, 10.0))))))) | ||
135 | ------------ tooltips | ||
136 | testdata/record02.lc 1:1-1:3 | ||
137 | RecordC ' ['RecItem "x" Float, 'RecItem "y" Float] | ||
138 | testdata/record02.lc 1:6-1:19 | ||
139 | RecordC ' ['RecItem "x" Float, 'RecItem "y" Float] | ||
140 | testdata/record02.lc 1:7-1:8 | ||
141 | String | RecItem | ||
142 | testdata/record02.lc 1:7-1:14 | ||
143 | [RecItem] | ||
144 | testdata/record02.lc 1:9-1:12 | ||
145 | Float | ||
146 | testdata/record02.lc 1:9-1:18 | ||
147 | HList | ||
148 | (Float : recItemType ('RecItem "y" Float) : map RecItem Type recItemType ' []) | ||
149 | testdata/record02.lc 1:13-1:14 | ||
150 | String | RecItem | [RecItem] | ||
151 | testdata/record02.lc 1:15-1:18 | ||
152 | Float | ((Float)) | ||
153 | testdata/record02.lc 2:1-2:3 | ||
154 | RecordC ' ['RecItem "x" Float, 'RecItem "y" Float, 'RecItem "z" Float] | ||
155 | testdata/record02.lc 2:6-2:26 | ||
156 | RecordC ' ['RecItem "x" Float, 'RecItem "y" Float, 'RecItem "z" Float] | ||
157 | testdata/record02.lc 2:7-2:8 | ||
158 | String | RecItem | ||
159 | testdata/record02.lc 2:7-2:20 | ||
160 | [RecItem] | ||
161 | testdata/record02.lc 2:9-2:12 | ||
162 | Float | ||
163 | testdata/record02.lc 2:9-2:25 | ||
164 | HList | ||
165 | (Float | ||
166 | : recItemType ('RecItem "y" Float) | ||
167 | : map RecItem Type recItemType ' ['RecItem "z" Float]) | ||
168 | testdata/record02.lc 2:13-2:14 | ||
169 | String | RecItem | ||
170 | testdata/record02.lc 2:13-2:20 | ||
171 | [RecItem] | ||
172 | testdata/record02.lc 2:15-2:18 | ||
173 | Float | ||
174 | testdata/record02.lc 2:15-2:25 | ||
175 | HList | ||
176 | (Float : recItemType ('RecItem "z" Float) : map RecItem Type recItemType ' []) | ||
177 | testdata/record02.lc 2:19-2:20 | ||
178 | String | RecItem | [RecItem] | ||
179 | testdata/record02.lc 2:21-2:25 | ||
180 | Float | ((Float)) | ||
181 | testdata/record02.lc 3:1-3:3 | ||
182 | RecordC | ||
183 | ' ['RecItem "v1" (RecordC ' ['RecItem "x" Float, 'RecItem "y" Float]) | ||
184 | , 'RecItem | ||
185 | "v2" | ||
186 | (RecordC ' ['RecItem "x" Float, 'RecItem "y" Float, 'RecItem "z" Float])] | ||
187 | testdata/record02.lc 3:6-3:20 | ||
188 | RecordC | ||
189 | ' ['RecItem "v1" (RecordC ' ['RecItem "x" Float, 'RecItem "y" Float]) | ||
190 | , 'RecItem | ||
191 | "v2" | ||
192 | (RecordC ' ['RecItem "x" Float, 'RecItem "y" Float, 'RecItem "z" Float])] | ||
193 | testdata/record02.lc 3:7-3:9 | ||
194 | String | RecItem | ||
195 | testdata/record02.lc 3:7-3:16 | ||
196 | [RecItem] | ||
197 | testdata/record02.lc 3:10-3:12 | ||
198 | RecordC ' ['RecItem "x" Float, 'RecItem "y" Float] | ||
199 | testdata/record02.lc 3:10-3:19 | ||
200 | HList | ||
201 | (RecordC ' ['RecItem "x" Float, 'RecItem "y" Float] | ||
202 | : recItemType | ||
203 | ('RecItem | ||
204 | "v2" | ||
205 | (RecordC ' ['RecItem "x" Float, 'RecItem "y" Float, 'RecItem "z" Float])) | ||
206 | : map RecItem Type recItemType ' []) | ||
207 | testdata/record02.lc 3:14-3:16 | ||
208 | String | RecItem | [RecItem] | ||
209 | testdata/record02.lc 3:17-3:19 | ||
210 | RecordC | ||
211 | ' ['RecItem "x" Float, 'RecItem "y" Float, 'RecItem "z" Float] | ((RecordC | ||
212 | ' ['RecItem "x" Float, 'RecItem "y" Float, 'RecItem "z" Float])) | ||
213 | testdata/record02.lc 4:1-4:2 | ||
214 | forall a | ||
215 | . Num (MatVecScalarElem a) | ||
216 | => forall (b :: [RecItem]) | ||
217 | . (isKeyC "x" a b, isKeyC "y" (MatVecScalarElem a) b) => RecordC b -> a | ||
218 | testdata/record02.lc 4:7-4:8 | ||
219 | _g | ||
220 | testdata/record02.lc 4:7-4:10 | ||
221 | _c | ||
222 | testdata/record02.lc 4:7-4:13 | ||
223 | MatVecScalarElem _d -> _d | ||
224 | testdata/record02.lc 4:7-4:17 | ||
225 | _e | ||
226 | testdata/record02.lc 4:9-4:10 | ||
227 | String | ||
228 | testdata/record02.lc 4:11-4:13 | ||
229 | forall a . Num (MatVecScalarElem a) => a -> MatVecScalarElem a -> a | ||
230 | testdata/record02.lc 4:14-4:15 | ||
231 | RecordC _e | ||
232 | testdata/record02.lc 4:14-4:17 | ||
233 | _b | ||
234 | testdata/record02.lc 4:16-4:17 | ||
235 | String | ||
236 | testdata/record02.lc 5:1-5:2 | ||
237 | forall a | ||
238 | . Num (MatVecScalarElem a) | ||
239 | => forall (b :: [RecItem]) | ||
240 | . isKeyC "x" a b | ||
241 | => forall (c :: [RecItem]) | ||
242 | . isKeyC "v1" (RecordC b) c | ||
243 | => forall (d :: [RecItem]) | ||
244 | . (isKeyC "z" (MatVecScalarElem a) d, isKeyC "v2" (RecordC d) c) | ||
245 | => RecordC c -> a | ||
246 | testdata/record02.lc 5:7-5:8 | ||
247 | _j | ||
248 | testdata/record02.lc 5:7-5:11 | ||
249 | _c | ||
250 | testdata/record02.lc 5:7-5:13 | ||
251 | _e | ||
252 | testdata/record02.lc 5:7-5:16 | ||
253 | MatVecScalarElem _f -> _f | ||
254 | testdata/record02.lc 5:7-5:23 | ||
255 | _i | ||
256 | testdata/record02.lc 5:9-5:11 | ||
257 | String | ||
258 | testdata/record02.lc 5:12-5:13 | ||
259 | String | ||
260 | testdata/record02.lc 5:14-5:16 | ||
261 | forall a . Num (MatVecScalarElem a) => a -> MatVecScalarElem a -> a | ||
262 | testdata/record02.lc 5:17-5:18 | ||
263 | RecordC _h | ||
264 | testdata/record02.lc 5:17-5:21 | ||
265 | _b | ||
266 | testdata/record02.lc 5:17-5:23 | ||
267 | _d | ||
268 | testdata/record02.lc 5:19-5:21 | ||
269 | String | ||
270 | testdata/record02.lc 5:22-5:23 | ||
271 | String | ||
272 | testdata/record02.lc 7:1-7:2 | ||
273 | forall a (b :: [RecItem]) | ||
274 | . isKeyC "x" a b | ||
275 | => (RecordC | ||
276 | ' ['RecItem "v1" (RecordC ' ['RecItem "x" Float, 'RecItem "y" Float]) | ||
277 | , 'RecItem | ||
278 | "v2" | ||
279 | (RecordC ' ['RecItem "x" Float, 'RecItem "y" Float, 'RecItem "z" Float])] | ||
280 | -> RecordC b) | ||
281 | -> a | ||
282 | testdata/record02.lc 7:7-7:15 | ||
283 | _c | ||
284 | testdata/record02.lc 7:8-7:9 | ||
285 | _e | ||
286 | testdata/record02.lc 7:10-7:12 | ||
287 | RecordC | ||
288 | ' ['RecItem "v1" (RecordC ' ['RecItem "x" Float, 'RecItem "y" Float]) | ||
289 | , 'RecItem | ||
290 | "v2" | ||
291 | (RecordC ' ['RecItem "x" Float, 'RecItem "y" Float, 'RecItem "z" Float])] | ||
292 | testdata/record02.lc 7:14-7:15 | ||
293 | String | ||
294 | testdata/record02.lc 8:1-8:2 | ||
295 | forall a (b :: [RecItem]) | ||
296 | . isKeyC "v" a b | ||
297 | => forall (c :: [RecItem]) | ||
298 | . isKeyC "c" (RecordC b) c | ||
299 | => forall (d :: [RecItem]) | ||
300 | . isKeyC "x" (RecordC c) d | ||
301 | => (RecordC | ||
302 | ' ['RecItem "v1" (RecordC ' ['RecItem "x" Float, 'RecItem "y" Float]) | ||
303 | , 'RecItem | ||
304 | "v2" | ||
305 | (RecordC ' ['RecItem "x" Float, 'RecItem "y" Float, 'RecItem "z" Float])] | ||
306 | -> RecordC d) | ||
307 | -> a | ||
308 | testdata/record02.lc 8:7-8:19 | ||
309 | _g | ||
310 | testdata/record02.lc 8:8-8:9 | ||
311 | _k | ||
312 | testdata/record02.lc 8:8-8:15 | ||
313 | _c | ||
314 | testdata/record02.lc 8:8-8:17 | ||
315 | _e | ||
316 | testdata/record02.lc 8:10-8:12 | ||
317 | RecordC | ||
318 | ' ['RecItem "v1" (RecordC ' ['RecItem "x" Float, 'RecItem "y" Float]) | ||
319 | , 'RecItem | ||
320 | "v2" | ||
321 | (RecordC ' ['RecItem "x" Float, 'RecItem "y" Float, 'RecItem "z" Float])] | ||
322 | testdata/record02.lc 8:14-8:15 | ||
323 | String | ||
324 | testdata/record02.lc 8:16-8:17 | ||
325 | String | ||
326 | testdata/record02.lc 8:18-8:19 | ||
327 | String | ||
328 | testdata/record02.lc 10:1-10:5 | ||
329 | Bool | ||
330 | testdata/record02.lc 10:8-12:15 | ||
331 | Bool | ||
332 | testdata/record02.lc 10:13-10:14 | ||
333 | forall a | ||
334 | . Num (MatVecScalarElem a) | ||
335 | => forall (b :: [RecItem]) | ||
336 | . (isKeyC "x" a b, isKeyC "y" (MatVecScalarElem a) b) => RecordC b -> a | ||
337 | testdata/record02.lc 10:13-10:17 | ||
338 | _d | ||
339 | testdata/record02.lc 10:13-10:20 | ||
340 | MatVecScalarElem Float -> Float | ||
341 | testdata/record02.lc 10:13-10:25 | ||
342 | Float | ||
343 | testdata/record02.lc 10:13-10:28 | ||
344 | MatVecScalarElem Float -> Float | ||
345 | testdata/record02.lc 10:13-10:33 | ||
346 | Float | ||
347 | testdata/record02.lc 10:15-10:17 | ||
348 | RecordC ' ['RecItem "x" Float, 'RecItem "y" Float] | ||
349 | testdata/record02.lc 10:18-10:20 | ||
350 | forall a . Num (MatVecScalarElem a) => a -> MatVecScalarElem a -> a | ||
351 | testdata/record02.lc 10:21-10:22 | ||
352 | forall a | ||
353 | . Num (MatVecScalarElem a) | ||
354 | => forall (b :: [RecItem]) | ||
355 | . (isKeyC "x" a b, isKeyC "y" (MatVecScalarElem a) b) => RecordC b -> a | ||
356 | testdata/record02.lc 10:21-10:25 | ||
357 | _d | ||
358 | testdata/record02.lc 10:23-10:25 | ||
359 | RecordC ' ['RecItem "x" Float, 'RecItem "y" Float, 'RecItem "z" Float] | ||
360 | testdata/record02.lc 10:26-10:28 | ||
361 | forall a . Num (MatVecScalarElem a) => a -> MatVecScalarElem a -> a | ||
362 | testdata/record02.lc 10:29-10:30 | ||
363 | forall a | ||
364 | . Num (MatVecScalarElem a) | ||
365 | => forall (b :: [RecItem]) | ||
366 | . isKeyC "x" a b | ||
367 | => forall (c :: [RecItem]) | ||
368 | . isKeyC "v1" (RecordC b) c | ||
369 | => forall (d :: [RecItem]) | ||
370 | . (isKeyC "z" (MatVecScalarElem a) d, isKeyC "v2" (RecordC d) c) | ||
371 | => RecordC c -> a | ||
372 | testdata/record02.lc 10:29-10:33 | ||
373 | _h | ||
374 | testdata/record02.lc 10:31-10:33 | ||
375 | RecordC | ||
376 | ' ['RecItem "v1" (RecordC ' ['RecItem "x" Float, 'RecItem "y" Float]) | ||
377 | , 'RecItem | ||
378 | "v2" | ||
379 | (RecordC ' ['RecItem "x" Float, 'RecItem "y" Float, 'RecItem "z" Float])] | ||
380 | testdata/record02.lc 11:13-11:17 | ||
381 | Bool | ||
382 | testdata/record02.lc 11:13-12:15 | ||
383 | Bool -> Bool | ||
384 | testdata/record02.lc 12:10-12:15 | ||
385 | Bool \ No newline at end of file | ||
diff --git a/testdata/reduce06.out b/testdata/reduce06.out index 4791ed55..2ddd9a75 100644 --- a/testdata/reduce06.out +++ b/testdata/reduce06.out | |||
@@ -1 +1,33 @@ | |||
1 | True \ No newline at end of file | 1 | main :: Bool |
2 | main = True | ||
3 | ------------ desugared source code | ||
4 | constf = _lhs constf (_rhs \(a :: _) (_ :: _) -> a) | ||
5 | |||
6 | main = _lhs main (_rhs ((\(a :: _) -> constf a False) True)) | ||
7 | ------------ core code | ||
8 | constf :: forall a b . a -> b -> a | ||
9 | constf = \_ _ -> _rhs \a _ -> a | ||
10 | |||
11 | main :: Bool | ||
12 | main = _rhs True | ||
13 | ------------ tooltips | ||
14 | testdata/reduce06.lc 1:1-1:7 | ||
15 | forall a b . a -> b -> a | ||
16 | testdata/reduce06.lc 1:18-1:19 | ||
17 | _d | ||
18 | testdata/reduce06.lc 3:1-3:5 | ||
19 | Bool | ||
20 | testdata/reduce06.lc 3:8-3:35 | ||
21 | Bool | ||
22 | testdata/reduce06.lc 3:15-3:21 | ||
23 | forall a b . a -> b -> a | ||
24 | testdata/reduce06.lc 3:15-3:23 | ||
25 | _a -> _c | ||
26 | testdata/reduce06.lc 3:15-3:29 | ||
27 | _b | ||
28 | testdata/reduce06.lc 3:22-3:23 | ||
29 | _d | ||
30 | testdata/reduce06.lc 3:24-3:29 | ||
31 | Bool | ||
32 | testdata/reduce06.lc 3:31-3:35 | ||
33 | Bool \ No newline at end of file | ||
diff --git a/testdata/swizzling.out b/testdata/swizzling.out index 4791ed55..295c8736 100644 --- a/testdata/swizzling.out +++ b/testdata/swizzling.out | |||
@@ -1 +1,89 @@ | |||
1 | True \ No newline at end of file | 1 | main :: Bool |
2 | main = True | ||
3 | ------------ desugared source code | ||
4 | v = _lhs v (_rhs (V3 1.0 2.0 3.0)) | ||
5 | |||
6 | v2 = _lhs v2 (_rhs (swizzvector v (V2 Sx Sx))) | ||
7 | |||
8 | v3 = _lhs v3 (_rhs (swizzscalar v Sx)) | ||
9 | |||
10 | main | ||
11 | = _lhs | ||
12 | main | ||
13 | (_rhs | ||
14 | ((\(a :: _) -> case'VecS | ||
15 | (\(_ :: _) (_ :: _) -> _) | ||
16 | (\(_ :: _) (_ :: _) -> undefined) | ||
17 | (\(b :: _) (c :: _) (d :: _) -> case'Bool | ||
18 | (\(_ :: _) -> _) | ||
19 | undefined | ||
20 | (case'Bool | ||
21 | (\(_ :: _) -> _) | ||
22 | undefined | ||
23 | (case'Bool (\(_ :: _) -> _) undefined True (2.0 == d)) | ||
24 | (1.0 == c)) | ||
25 | (1.0 == b)) | ||
26 | (\(_ :: _) (_ :: _) (_ :: _) (_ :: _) -> undefined) | ||
27 | a) | ||
28 | (swizzvector v (V3 Sx Sx Sy)))) | ||
29 | ------------ core code | ||
30 | main :: Bool | ||
31 | main = _rhs True | ||
32 | |||
33 | v :: VecS Float 3 | ||
34 | v = _rhs (V3 1.0 2.0 3.0) | ||
35 | |||
36 | v2 :: VecS Float 2 | ||
37 | v2 = _rhs (V2 1.0 1.0) | ||
38 | |||
39 | v3 :: Float | ||
40 | v3 = _rhs 1.0 | ||
41 | ------------ tooltips | ||
42 | testdata/swizzling.lc 3:1-3:2 | ||
43 | VecS Float 3 | ||
44 | testdata/swizzling.lc 3:5-3:7 | ||
45 | forall a . a -> a -> a -> VecS a 3 | ||
46 | testdata/swizzling.lc 3:5-3:11 | ||
47 | Float -> Float -> VecS Float 3 | ||
48 | testdata/swizzling.lc 3:5-3:15 | ||
49 | Float -> VecS Float 3 | ||
50 | testdata/swizzling.lc 3:5-3:19 | ||
51 | VecS Float 3 | ||
52 | testdata/swizzling.lc 3:8-3:11 | ||
53 | Float | ||
54 | testdata/swizzling.lc 3:12-3:15 | ||
55 | Float | ||
56 | testdata/swizzling.lc 3:16-3:19 | ||
57 | Float | ||
58 | testdata/swizzling.lc 4:1-4:3 | ||
59 | VecS Float 2 | ||
60 | testdata/swizzling.lc 4:6-4:7 | ||
61 | VecS Float 3 | ||
62 | testdata/swizzling.lc 4:6-4:10 | ||
63 | VecS Float 2 | ||
64 | testdata/swizzling.lc 5:1-5:3 | ||
65 | Float | ||
66 | testdata/swizzling.lc 5:6-5:7 | ||
67 | VecS Float 3 | ||
68 | testdata/swizzling.lc 5:6-5:9 | ||
69 | Float | ||
70 | testdata/swizzling.lc 7:1-7:5 | ||
71 | Bool | ||
72 | testdata/swizzling.lc 7:8-8:27 | ||
73 | Bool | ||
74 | testdata/swizzling.lc 7:13-7:14 | ||
75 | VecS Float 3 | ||
76 | testdata/swizzling.lc 7:13-7:18 | ||
77 | VecS Float 3 | ||
78 | testdata/swizzling.lc 8:23-8:27 | ||
79 | Bool | Bool | Bool | Bool | ||
80 | ------------ warnings | ||
81 | Uncovered pattern(s) at testdata/swizzling.lc:7:13: | ||
82 | main = case v%xxy of | ||
83 | ^^^^^ | ||
84 | Missing case(s): | ||
85 | (V2 _ _) | ||
86 | (V3 _ _ _) | False <- 1.0 == _c | ||
87 | (V3 _ _ _) | True <- 1.0 == _c, False <- 1.0 == _b | ||
88 | (V3 _ _ _) | True <- 1.0 == _c, True <- 1.0 == _b, False <- 2.0 == _a | ||
89 | (V4 _ _ _ _) \ No newline at end of file | ||
diff --git a/testdata/typeclass0.out b/testdata/typeclass0.out index 4791ed55..bd1ec8c4 100644 --- a/testdata/typeclass0.out +++ b/testdata/typeclass0.out | |||
@@ -1 +1,27 @@ | |||
1 | True \ No newline at end of file | 1 | main :: Bool |
2 | main = True | ||
3 | ------------ desugared source code | ||
4 | main | ||
5 | = _lhs | ||
6 | main | ||
7 | (_rhs | ||
8 | ((\(a :: _) -> case'Bool (\(_ :: _) -> _) undefined True (1.0 == a)) | ||
9 | (fromInt 1))) | ||
10 | ------------ core code | ||
11 | main :: Bool | ||
12 | main = _rhs True | ||
13 | ------------ tooltips | ||
14 | testdata/typeclass0.lc 2:1-2:5 | ||
15 | Bool | ||
16 | testdata/typeclass0.lc 2:8-3:16 | ||
17 | Bool | ||
18 | testdata/typeclass0.lc 2:13-2:14 | ||
19 | _b | ||
20 | testdata/typeclass0.lc 3:12-3:16 | ||
21 | Bool | ||
22 | ------------ warnings | ||
23 | Uncovered pattern(s) at testdata/typeclass0.lc:2:13: | ||
24 | main = case 1 of | ||
25 | ^ | ||
26 | Missing case(s): | ||
27 | _ | False <- 1.0 == _a \ No newline at end of file | ||
diff --git a/testdata/typesyn.out b/testdata/typesyn.out index 4791ed55..6dc5080a 100644 --- a/testdata/typesyn.out +++ b/testdata/typesyn.out | |||
@@ -1 +1,68 @@ | |||
1 | True \ No newline at end of file | 1 | main :: Bool |
2 | main = True | ||
3 | ------------ desugared source code | ||
4 | 'B = _lhs 'B (_rhs 'Bool) | ||
5 | |||
6 | 'F = _lhs 'F \(a :: _) (b :: _) -> _rhs ' (a, b) | ||
7 | |||
8 | main = _lhs main (_rhs ((True :: B) && fst ((True, 'c') :: F Bool Char))) | ||
9 | ------------ core code | ||
10 | 'B :: Type | ||
11 | 'B = _rhs 'Bool | ||
12 | |||
13 | 'F :: Type -> Type -> Type | ||
14 | 'F = \a b -> _rhs ' (a, b) | ||
15 | |||
16 | main :: Bool | ||
17 | main = _rhs True | ||
18 | ------------ tooltips | ||
19 | testdata/typesyn.lc 3:6-3:7 | ||
20 | Type | ||
21 | testdata/typesyn.lc 3:10-3:14 | ||
22 | Type | ||
23 | testdata/typesyn.lc 5:6-5:7 | ||
24 | Type -> Type -> Type | ||
25 | testdata/typesyn.lc 5:14-5:20 | ||
26 | Type | ||
27 | testdata/typesyn.lc 5:15-5:16 | ||
28 | _e | ||
29 | testdata/typesyn.lc 5:15-5:19 | ||
30 | [Type] | ||
31 | testdata/typesyn.lc 5:18-5:19 | ||
32 | _c | [Type] | ||
33 | testdata/typesyn.lc 7:1-7:5 | ||
34 | Bool | ||
35 | testdata/typesyn.lc 7:8-7:22 | ||
36 | Bool -> Bool | ||
37 | testdata/typesyn.lc 7:8-7:55 | ||
38 | Bool | ||
39 | testdata/typesyn.lc 7:9-7:13 | ||
40 | Bool | ||
41 | testdata/typesyn.lc 7:9-7:18 | ||
42 | B | ||
43 | testdata/typesyn.lc 7:17-7:18 | ||
44 | Type | ||
45 | testdata/typesyn.lc 7:20-7:22 | ||
46 | Bool -> Bool -> Bool | ||
47 | testdata/typesyn.lc 7:23-7:26 | ||
48 | forall a b . (a, b) -> a | ||
49 | testdata/typesyn.lc 7:23-7:55 | ||
50 | Bool | ||
51 | testdata/typesyn.lc 7:28-7:39 | ||
52 | (Bool, Char) | ||
53 | testdata/typesyn.lc 7:28-7:54 | ||
54 | F Bool Char | ||
55 | testdata/typesyn.lc 7:29-7:33 | ||
56 | Bool | ||
57 | testdata/typesyn.lc 7:35-7:38 | ||
58 | Char | ((Char)) | ||
59 | testdata/typesyn.lc 7:43-7:44 | ||
60 | Type -> Type -> Type | ||
61 | testdata/typesyn.lc 7:43-7:49 | ||
62 | Type -> Type | ||
63 | testdata/typesyn.lc 7:43-7:54 | ||
64 | Type | ||
65 | testdata/typesyn.lc 7:45-7:49 | ||
66 | Type | ||
67 | testdata/typesyn.lc 7:50-7:54 | ||
68 | Type \ No newline at end of file | ||