diff options
author | Péter Diviánszky <divipp@gmail.com> | 2016-04-20 11:39:57 +0200 |
---|---|---|
committer | Péter Diviánszky <divipp@gmail.com> | 2016-04-20 11:39:57 +0200 |
commit | f57422af1b60ddab1339138472de3aa83cc1b2a3 (patch) | |
tree | c45a556b82aa54136ceb46b35a715924dc263833 | |
parent | 2150cf6ecaa227696d2fc7ff9e2258c76a309ee7 (diff) |
tweak pattern source infos
-rw-r--r-- | src/LambdaCube/Compiler/Lexer.hs | 3 | ||||
-rw-r--r-- | src/LambdaCube/Compiler/Parser.hs | 122 | ||||
-rw-r--r-- | testdata/Builtins.out | 4 | ||||
-rw-r--r-- | testdata/Prelude.out | 10 | ||||
-rw-r--r-- | testdata/ambig.out | 2 | ||||
-rw-r--r-- | testdata/record01.reject.out | 6 |
6 files changed, 65 insertions, 82 deletions
diff --git a/src/LambdaCube/Compiler/Lexer.hs b/src/LambdaCube/Compiler/Lexer.hs index 066e156a..65d3c454 100644 --- a/src/LambdaCube/Compiler/Lexer.hs +++ b/src/LambdaCube/Compiler/Lexer.hs | |||
@@ -337,10 +337,9 @@ switchNamespace = \case ExpNS -> TypeNS; TypeNS -> ExpNS | |||
337 | 337 | ||
338 | modifyLevel f = local $ \e -> e {namespace = f $ namespace e} | 338 | modifyLevel f = local $ \e -> e {namespace = f $ namespace e} |
339 | 339 | ||
340 | typeNS, expNS, switchNS :: Parse r w a -> Parse r w a | 340 | typeNS, expNS :: Parse r w a -> Parse r w a |
341 | typeNS = modifyLevel $ const TypeNS | 341 | typeNS = modifyLevel $ const TypeNS |
342 | expNS = modifyLevel $ const ExpNS | 342 | expNS = modifyLevel $ const ExpNS |
343 | switchNS = modifyLevel switchNamespace | ||
344 | 343 | ||
345 | -------------------------------------------------------------------------------- identifiers | 344 | -------------------------------------------------------------------------------- identifiers |
346 | 345 | ||
diff --git a/src/LambdaCube/Compiler/Parser.hs b/src/LambdaCube/Compiler/Parser.hs index 433a2181..db538f1b 100644 --- a/src/LambdaCube/Compiler/Parser.hs +++ b/src/LambdaCube/Compiler/Parser.hs | |||
@@ -376,7 +376,7 @@ parseTerm_ ge = \case | |||
376 | <|> compileCase ge <$ reserved "case" <*> parseTerm PrecLam <* reserved "of" <*> do | 376 | <|> compileCase ge <$ reserved "case" <*> parseTerm PrecLam <* reserved "of" <*> do |
377 | identation False $ do | 377 | identation False $ do |
378 | (fe, p) <- longPattern | 378 | (fe, p) <- longPattern |
379 | (,) p <$> parseRHS (deBruijnify fe) "->" | 379 | (,) p . deBruijnify fe <$> parseRHS "->" |
380 | PrecAnn -> level PrecOp $ \t -> SAnn t <$> parseType Nothing | 380 | PrecAnn -> level PrecOp $ \t -> SAnn t <$> parseType Nothing |
381 | PrecOp -> (notOp False <|> notExp) >>= calculatePrecs ge where | 381 | PrecOp -> (notOp False <|> notExp) >>= calculatePrecs ge where |
382 | notExp = (++) <$> ope <*> notOp True | 382 | notExp = (++) <$> ope <*> notOp True |
@@ -398,7 +398,7 @@ parseTerm_ ge = \case | |||
398 | <|> Wildcard (Wildcard SType) <$ reserved "_" | 398 | <|> Wildcard (Wildcard SType) <$ reserved "_" |
399 | <|> mkLets ge <$ reserved "let" <*> parseDefs <* reserved "in" <*> parseTerm PrecLam | 399 | <|> mkLets ge <$ reserved "let" <*> parseDefs <* reserved "in" <*> parseTerm PrecLam |
400 | <|> SGlobal <$> lowerCase | 400 | <|> SGlobal <$> lowerCase |
401 | <|> SGlobal <$> upperCase_ -- todo: move under ppa? | 401 | <|> SGlobal <$> upperCase_ |
402 | <|> braces (mkRecord <$> commaSep ((,) <$> lowerCase <* symbol ":" <*> parseTerm PrecLam)) | 402 | <|> braces (mkRecord <$> commaSep ((,) <$> lowerCase <* symbol ":" <*> parseTerm PrecLam)) |
403 | <|> char '\'' *> ppa switchNamespace | 403 | <|> char '\'' *> ppa switchNamespace |
404 | <|> ppa id | 404 | <|> ppa id |
@@ -519,11 +519,18 @@ patLam f ge (v, t) p e = SLam v t $ compileGuardTree f f ge $ compilePatts [(p, | |||
519 | 519 | ||
520 | data Pat | 520 | data Pat |
521 | = PVar SIName -- Int | 521 | = PVar SIName -- Int |
522 | | PCon SIName [ParPat] | 522 | | PCon_ SI SIName [ParPat] |
523 | | ViewPat SExp ParPat | 523 | | ViewPat_ SI SExp ParPat |
524 | | PatType ParPat SExp | 524 | | PatType_ SI ParPat SExp |
525 | deriving Show | 525 | deriving Show |
526 | 526 | ||
527 | pattern PCon n pp <- PCon_ _ n pp | ||
528 | where PCon n pp = PCon_ (fst n <> sourceInfo pp) n pp | ||
529 | pattern ViewPat e pp <- ViewPat_ _ e pp | ||
530 | where ViewPat e pp = ViewPat_ (sourceInfo e <> sourceInfo pp) e pp | ||
531 | pattern PatType pp e <- PatType_ _ pp e | ||
532 | where PatType pp e = PatType_ (sourceInfo e <> sourceInfo pp) pp e | ||
533 | |||
527 | pattern PParens p = ViewPat (SBuiltin "parens") (ParPat [p]) | 534 | pattern PParens p = ViewPat (SBuiltin "parens") (ParPat [p]) |
528 | 535 | ||
529 | -- parallel patterns like v@(f -> [])@(Just x) | 536 | -- parallel patterns like v@(f -> [])@(Just x) |
@@ -536,30 +543,21 @@ mapPP f = \case | |||
536 | mapP :: (SExp -> SExp) -> Pat -> Pat | 543 | mapP :: (SExp -> SExp) -> Pat -> Pat |
537 | mapP f = \case | 544 | mapP f = \case |
538 | PVar n -> PVar n | 545 | PVar n -> PVar n |
539 | PCon n pp -> PCon n (mapPP f <$> pp) | 546 | PCon_ si n pp -> PCon_ si n (mapPP f <$> pp) |
540 | PParens p -> PParens (mapP f p) | 547 | ViewPat_ si e pp -> ViewPat_ si (f e) (mapPP f pp) |
541 | ViewPat e pp -> ViewPat (f e) (mapPP f pp) | 548 | PatType_ si pp e -> PatType_ si (mapPP f pp) (f e) |
542 | PatType pp e -> PatType (mapPP f pp) (f e) | ||
543 | |||
544 | --upP i j = mapP (up_ j i) | ||
545 | |||
546 | varPP = length . getPPVars_ | ||
547 | varP = length . getPVars_ | ||
548 | 549 | ||
549 | getPVars :: Pat -> [SIName] | 550 | getPVars = \case |
550 | getPVars = reverse . getPVars_ | ||
551 | |||
552 | getPPVars = reverse . getPPVars_ | ||
553 | |||
554 | getPVars_ = \case | ||
555 | PVar n -> [n] | 551 | PVar n -> [n] |
556 | PCon _ pp -> foldMap getPPVars_ pp | 552 | PCon _ pp -> foldMap getPPVars pp |
557 | PParens p -> getPVars_ p | 553 | ViewPat e pp -> getPPVars pp |
558 | ViewPat e pp -> getPPVars_ pp | 554 | PatType pp e -> getPPVars pp |
559 | PatType pp e -> getPPVars_ pp | 555 | |
556 | getPPVars = \case | ||
557 | ParPat pp -> foldMap getPVars pp | ||
560 | 558 | ||
561 | getPPVars_ = \case | 559 | varPP = length . getPPVars |
562 | ParPat pp -> foldMap getPVars_ pp | 560 | varP = length . getPVars |
563 | 561 | ||
564 | instance SourceInfo ParPat where | 562 | instance SourceInfo ParPat where |
565 | sourceInfo (ParPat ps) = sourceInfo ps | 563 | sourceInfo (ParPat ps) = sourceInfo ps |
@@ -567,34 +565,46 @@ instance SourceInfo ParPat where | |||
567 | instance SourceInfo Pat where | 565 | instance SourceInfo Pat where |
568 | sourceInfo = \case | 566 | sourceInfo = \case |
569 | PVar (si,_) -> si | 567 | PVar (si,_) -> si |
570 | PCon (si,_) ps -> si <> sourceInfo ps | 568 | PCon_ si _ _ -> si |
571 | ViewPat e ps -> sourceInfo e <> sourceInfo ps | 569 | ViewPat_ si _ _ -> si |
572 | PatType ps e -> sourceInfo ps <> sourceInfo e | 570 | PatType_ si _ _ -> si |
571 | |||
572 | instance SetSourceInfo Pat where | ||
573 | setSI si = \case | ||
574 | PVar (_, n) -> PVar (si, n) | ||
575 | PCon_ _ a b -> PCon_ si a b | ||
576 | ViewPat_ _ a b -> ViewPat_ si a b | ||
577 | PatType_ _ a b -> PatType_ si a b | ||
573 | 578 | ||
574 | -------------------------------------------------------------------------------- pattern parsing | 579 | -------------------------------------------------------------------------------- pattern parsing |
575 | 580 | ||
576 | parsePat :: Prec -> BodyParser Pat | 581 | parsePat p = appRange $ flip setSI <$> parsePat_ p |
577 | parsePat = \case | 582 | |
578 | PrecAnn -> | 583 | parsePat_ :: Prec -> BodyParser Pat |
584 | parsePat_ = \case | ||
585 | PrecAnn -> | ||
579 | patType <$> parsePat PrecOp <*> parseType (Just $ Wildcard SType) | 586 | patType <$> parsePat PrecOp <*> parseType (Just $ Wildcard SType) |
580 | PrecOp -> | 587 | PrecOp -> |
581 | join $ calculatePatPrecs <$> dsInfo <*> p_ | 588 | join $ calculatePatPrecs <$> dsInfo <*> p_ |
582 | where | 589 | where |
583 | p_ = (,) <$> parsePat PrecApp <*> option [] (colonSymbols >>= p) | 590 | p_ = (,) <$> parsePat PrecApp <*> option [] (colonSymbols >>= p) |
584 | p op = do (exp, op') <- try "pattern" ((,) <$> parsePat PrecApp <*> colonSymbols) | 591 | p op = do (exp, op') <- try "pattern" ((,) <$> parsePat PrecApp <*> colonSymbols) |
585 | ((op, exp):) <$> p op' | 592 | ((op, exp):) <$> p op' |
586 | <|> pure . (,) op <$> parsePat PrecAnn | 593 | <|> pure . (,) op <$> parsePat PrecAnn |
587 | PrecApp -> | 594 | PrecApp -> |
588 | PCon <$> upperCase_ <*> many (ParPat . pure <$> parsePat PrecAtom) | 595 | PCon <$> upperCase_ <*> many (ParPat . pure <$> parsePat PrecAtom) |
589 | <|> parsePat PrecAtom | 596 | <|> parsePat_ PrecAtom |
590 | PrecAtom -> | 597 | PrecAtom -> |
591 | mkLit <$> asks namespace <*> try "literal" parseLit | 598 | mkLit <$> asks namespace <*> try "literal" parseLit |
592 | <|> flip PCon [] <$> upperCase_ | 599 | <|> flip PCon [] <$> upperCase_ |
593 | <|> char '\'' *> switchNS (parsePat PrecAtom) | ||
594 | <|> PVar <$> patVar | 600 | <|> PVar <$> patVar |
595 | <|> (\ns -> pConSI . mkListPat ns) <$> asks namespace <*> brackets patlist | 601 | <|> char '\'' *> ppa switchNamespace |
596 | <|> (\ns -> pConSI . mkTupPat ns) <$> asks namespace <*> parens patlist | 602 | <|> ppa id |
597 | where | 603 | where |
604 | ppa tick = | ||
605 | brackets (mkListPat . tick <$> asks namespace <*> patlist) | ||
606 | <|> parens (mkTupPat . tick <$> asks namespace <*> patlist) | ||
607 | |||
598 | litP = flip ViewPat (ParPat [PCon (mempty, "True") []]) . SAppV (SBuiltin "==") | 608 | litP = flip ViewPat (ParPat [PCon (mempty, "True") []]) . SAppV (SBuiltin "==") |
599 | 609 | ||
600 | mkLit TypeNS (LInt n) = toNatP n -- todo: elim this alternative | 610 | mkLit TypeNS (LInt n) = toNatP n -- todo: elim this alternative |
@@ -605,9 +615,6 @@ parsePat = \case | |||
605 | run 0 = PCon (mempty, "Zero") [] | 615 | run 0 = PCon (mempty, "Zero") [] |
606 | run n | n > 0 = PCon (mempty, "Succ") [ParPat [run $ n-1]] | 616 | run n | n > 0 = PCon (mempty, "Succ") [ParPat [run $ n-1]] |
607 | 617 | ||
608 | pConSI (PCon (_, n) ps) = PCon (sourceInfo ps, n) ps | ||
609 | pConSI p = p | ||
610 | |||
611 | patlist = commaSep $ parsePat PrecAnn | 618 | patlist = commaSep $ parsePat PrecAnn |
612 | 619 | ||
613 | mkListPat TypeNS [p] = PCon (debugSI "mkListPat4", "'List") [ParPat [p]] | 620 | mkListPat TypeNS [p] = PCon (debugSI "mkListPat4", "'List") [ParPat [p]] |
@@ -615,22 +622,22 @@ parsePat = \case | |||
615 | mkListPat _ [] = PCon (debugSI "mkListPat3", "Nil") [] | 622 | mkListPat _ [] = PCon (debugSI "mkListPat3", "Nil") [] |
616 | 623 | ||
617 | --mkTupPat :: [Pat] -> Pat | 624 | --mkTupPat :: [Pat] -> Pat |
618 | mkTupPat ns [PParens x] = ff [x] | 625 | -- TODO: tup type pattern in type namespace |
619 | mkTupPat ns [x] = PParens x | 626 | mkTupPat ns [PParens x] = mkTup [x] |
620 | mkTupPat ns ps = ff ps | 627 | mkTupPat ns [x] = PParens x |
628 | mkTupPat ns ps = mkTup ps | ||
621 | 629 | ||
622 | ff ps = foldr (\a b -> PCon (mempty, "HCons") (ParPat . (:[]) <$> [a, b])) (PCon (mempty, "HNil") []) ps | 630 | mkTup ps = foldr (\a b -> PCon (mempty, "HCons") (ParPat . (:[]) <$> [a, b])) (PCon (mempty, "HNil") []) ps |
623 | 631 | ||
624 | patType p (Wildcard SType) = p | 632 | patType p (Wildcard SType) = p |
625 | patType p t = PatType (ParPat [p]) t | 633 | patType p t = PatType (ParPat [p]) t |
626 | 634 | ||
627 | calculatePatPrecs dcls (e, xs) = postponedCheck dcls $ calcPrec (\op x y -> PCon op $ ParPat . (:[]) <$> [x, y]) (getFixity dcls . snd) e xs | 635 | calculatePatPrecs dcls (e, xs) = postponedCheck dcls $ calcPrec (\op x y -> PCon op $ ParPat . (:[]) <$> [x, y]) (getFixity dcls . snd) e xs |
628 | 636 | ||
629 | longPattern = parsePat PrecAnn <&> (getPVars &&& id) | 637 | longPattern = parsePat PrecAnn <&> (reverse . getPVars &&& id) |
630 | --patternAtom = parsePat PrecAtom <&> (getPVars &&& id) | ||
631 | 638 | ||
632 | telescopePat = do | 639 | telescopePat = do |
633 | (a, b) <- fmap (getPPVars . ParPat . map snd &&& id) $ many $ uncurry f <$> hiddenTerm (parsePat PrecAtom) (parsePat PrecAtom) | 640 | (a, b) <- fmap (reverse . foldMap (getPVars . snd) &&& id) $ many $ uncurry f <$> hiddenTerm (parsePat PrecAtom) (parsePat PrecAtom) |
634 | checkPattern a | 641 | checkPattern a |
635 | return (a, b) | 642 | return (a, b) |
636 | where | 643 | where |
@@ -668,10 +675,7 @@ mapGT k i = \case | |||
668 | upGT k i = mapGT k $ \k -> up_ i k | 675 | upGT k i = mapGT k $ \k -> up_ i k |
669 | 676 | ||
670 | substGT i j = mapGT 0 $ \k -> rearrangeS 0 $ \r -> if r == k + i then k + j else if r > k + i then r - 1 else r | 677 | substGT i j = mapGT 0 $ \k -> rearrangeS 0 $ \r -> if r == k + i then k + j else if r > k + i then r - 1 else r |
671 | {- | 678 | |
672 | dbfGT :: [SIName] -> GuardTree -> GuardTree | ||
673 | dbfGT v = mapGT 0 $ \k -> deBruijnify_ k v | ||
674 | -} | ||
675 | -- todo: clenup | 679 | -- todo: clenup |
676 | compilePatts :: [(Pat, Int)] -> Either [(SExp, SExp)] SExp -> GuardTree | 680 | compilePatts :: [(Pat, Int)] -> Either [(SExp, SExp)] SExp -> GuardTree |
677 | compilePatts ps gu = cp [] ps | 681 | compilePatts ps gu = cp [] ps |
@@ -866,7 +870,7 @@ parseDef = | |||
866 | ] | 870 | ] |
867 | 871 | ||
868 | 872 | ||
869 | parseRHS fe tok = fmap (fmap (fe *** fe) +++ fe) $ do | 873 | parseRHS tok = do |
870 | fmap Left . some $ (,) <$ reservedOp "|" <*> parseTerm PrecOp <* reservedOp tok <*> parseTerm PrecLam | 874 | fmap Left . some $ (,) <$ reservedOp "|" <*> parseTerm PrecOp <* reservedOp tok <*> parseTerm PrecLam |
871 | <|> do | 875 | <|> do |
872 | reservedOp tok | 876 | reservedOp tok |
@@ -889,7 +893,7 @@ funAltDef parseOpName parseName = do | |||
889 | checkPattern fee | 893 | checkPattern fee |
890 | return (n, (fee, (,) (Visible, Wildcard SType) <$> [a1, mapP (deBruijnify e') a2])) | 894 | return (n, (fee, (,) (Visible, Wildcard SType) <$> [a1, mapP (deBruijnify e') a2])) |
891 | <|> do try "lhs" $ (,) <$> parseName <*> telescopePat <* lookAhead (reservedOp "=" <|> reservedOp "|") | 895 | <|> do try "lhs" $ (,) <$> parseName <*> telescopePat <* lookAhead (reservedOp "=" <|> reservedOp "|") |
892 | FunAlt n tss <$> parseRHS (deBruijnify fee) "=" | 896 | FunAlt n tss . deBruijnify fee <$> parseRHS "=" |
893 | 897 | ||
894 | valueDef :: BodyParser [Stmt] | 898 | valueDef :: BodyParser [Stmt] |
895 | valueDef = do | 899 | valueDef = do |
@@ -905,7 +909,7 @@ desugarValueDef ds p e | |||
905 | | (i, x) <- zip [0..] dns | 909 | | (i, x) <- zip [0..] dns |
906 | ] | 910 | ] |
907 | where | 911 | where |
908 | dns = getPVars p | 912 | dns = reverse $ getPVars p |
909 | n = mangleNames dns | 913 | n = mangleNames dns |
910 | 914 | ||
911 | mangleNames xs = (foldMap fst xs, "_" ++ intercalate "_" (map snd xs)) | 915 | mangleNames xs = (foldMap fst xs, "_" ++ intercalate "_" (map snd xs)) |
@@ -981,7 +985,7 @@ desugarMutual ds xs = xs | |||
981 | | (i, x) <- zip [0..] dns | 985 | | (i, x) <- zip [0..] dns |
982 | ] | 986 | ] |
983 | where | 987 | where |
984 | dns = getPVars p | 988 | dns = reverse $ getPVars p |
985 | n = mangleNames dns | 989 | n = mangleNames dns |
986 | (ps, es) = unzip [(n, e) | Let n ~Nothing ~Nothing [] e <- xs] | 990 | (ps, es) = unzip [(n, e) | Let n ~Nothing ~Nothing [] e <- xs] |
987 | tup = "Tuple" ++ show (length xs) | 991 | tup = "Tuple" ++ show (length xs) |
diff --git a/testdata/Builtins.out b/testdata/Builtins.out index 45100590..8898f2fc 100644 --- a/testdata/Builtins.out +++ b/testdata/Builtins.out | |||
@@ -2069,8 +2069,6 @@ testdata/Builtins.lc 253:24-253:36 {a} -> {b} -> {c:PrimitiveType} -> a->b -> P | |||
2069 | testdata/Builtins.lc 253:24-253:38 Primitive V6 V0 -> Primitive V6 V1 | 2069 | testdata/Builtins.lc 253:24-253:38 Primitive V6 V0 -> Primitive V6 V1 |
2070 | testdata/Builtins.lc 253:37-253:38 V8->V8 | 2070 | testdata/Builtins.lc 253:37-253:38 V8->V8 |
2071 | testdata/Builtins.lc 255:30-255:38 Type->Type | 2071 | testdata/Builtins.lc 255:30-255:38 Type->Type |
2072 | testdata/Builtins.lc 255:40-255:41 Type | ||
2073 | testdata/Builtins.lc 255:40-255:46 Type->Type | ||
2074 | testdata/Builtins.lc 255:45-255:46 Type | Type->Type | 2072 | testdata/Builtins.lc 255:45-255:46 Type | Type->Type |
2075 | testdata/Builtins.lc 260:1-260:12 {a:PrimitiveType} -> {b : List Type} -> {c : List Type} -> {d : b ~ 'map Type Type ListElem c} -> HList c -> PrimitiveStream a (HList b) | 2073 | testdata/Builtins.lc 260:1-260:12 {a:PrimitiveType} -> {b : List Type} -> {c : List Type} -> {d : b ~ 'map Type Type ListElem c} -> HList c -> PrimitiveStream a (HList b) |
2076 | testdata/Builtins.lc 260:32-260:119 Type | 2074 | testdata/Builtins.lc 260:32-260:119 Type |
@@ -2881,8 +2879,6 @@ testdata/Builtins.lc 519:24-519:32 (V3, V1) | |||
2881 | testdata/Builtins.lc 519:25-519:28 V5 | 2879 | testdata/Builtins.lc 519:25-519:28 V5 |
2882 | testdata/Builtins.lc 519:30-519:31 ((V1)) | V4 | 2880 | testdata/Builtins.lc 519:30-519:31 ((V1)) | V4 |
2883 | testdata/Builtins.lc 520:1-520:8 {a:Nat} -> {b : List Type} -> FrameBuffer a ('map Type ImageKind FragmentOperationKind b) -> (HList b, List (Fragment a (HList ('imageType' ('map Type ImageKind FragmentOperationKind b))))) -> FrameBuffer a ('map Type ImageKind FragmentOperationKind b) | 2881 | testdata/Builtins.lc 520:1-520:8 {a:Nat} -> {b : List Type} -> FrameBuffer a ('map Type ImageKind FragmentOperationKind b) -> (HList b, List (Fragment a (HList ('imageType' ('map Type ImageKind FragmentOperationKind b))))) -> FrameBuffer a ('map Type ImageKind FragmentOperationKind b) |
2884 | testdata/Builtins.lc 520:13-520:21 V3 | ||
2885 | testdata/Builtins.lc 520:13-520:46 FrameBuffer V1 ('map Type ImageKind FragmentOperationKind V0) | ||
2886 | testdata/Builtins.lc 520:25-520:35 {a : List ImageKind} -> {b:Nat} -> {c : List Type} -> {d : a ~ 'map Type ImageKind FragmentOperationKind c} -> HList c -> FragmentStream b (HList ('imageType' a)) -> FrameBuffer b a -> FrameBuffer b a | 2882 | testdata/Builtins.lc 520:25-520:35 {a : List ImageKind} -> {b:Nat} -> {c : List Type} -> {d : a ~ 'map Type ImageKind FragmentOperationKind c} -> HList c -> FragmentStream b (HList ('imageType' a)) -> FrameBuffer b a -> FrameBuffer b a |
2887 | testdata/Builtins.lc 520:25-520:39 FragmentStream V1 (HList ('imageType' ('map Type ImageKind FragmentOperationKind V0))) -> FrameBuffer V2 ('map Type ImageKind FragmentOperationKind V1) -> FrameBuffer V3 ('map Type ImageKind FragmentOperationKind V2) | 2883 | testdata/Builtins.lc 520:25-520:39 FragmentStream V1 (HList ('imageType' ('map Type ImageKind FragmentOperationKind V0))) -> FrameBuffer V2 ('map Type ImageKind FragmentOperationKind V1) -> FrameBuffer V3 ('map Type ImageKind FragmentOperationKind V2) |
2888 | testdata/Builtins.lc 520:25-520:43 FrameBuffer V1 ('map Type ImageKind FragmentOperationKind V0) -> FrameBuffer V2 ('map Type ImageKind FragmentOperationKind V1) | 2884 | testdata/Builtins.lc 520:25-520:43 FrameBuffer V1 ('map Type ImageKind FragmentOperationKind V0) -> FrameBuffer V2 ('map Type ImageKind FragmentOperationKind V1) |
diff --git a/testdata/Prelude.out b/testdata/Prelude.out index 6f5c5a87..89f6b9ac 100644 --- a/testdata/Prelude.out +++ b/testdata/Prelude.out | |||
@@ -187,15 +187,11 @@ testdata/Prelude.lc 23:17-23:18 V5 | |||
187 | testdata/Prelude.lc 23:20-23:21 V6 | 187 | testdata/Prelude.lc 23:20-23:21 V6 |
188 | testdata/Prelude.lc 23:22-23:23 V7 | 188 | testdata/Prelude.lc 23:22-23:23 V7 |
189 | testdata/Prelude.lc 25:1-25:8 {a} -> {b} -> {c} -> (a -> c->b) -> (a, c)->b | 189 | testdata/Prelude.lc 25:1-25:8 {a} -> {b} -> {c} -> (a -> c->b) -> (a, c)->b |
190 | testdata/Prelude.lc 25:12-25:16 V4 | ||
191 | testdata/Prelude.lc 25:12-25:25 V1 | ||
192 | testdata/Prelude.lc 25:20-25:21 V14 | 190 | testdata/Prelude.lc 25:20-25:21 V14 |
193 | testdata/Prelude.lc 25:20-25:25 HList V2 -> V2 | V2 | V2 -> HList V2 -> V2 | V3 | 191 | testdata/Prelude.lc 25:20-25:25 HList V2 -> V2 | V2 | V2 -> HList V2 -> V2 | V3 |
194 | testdata/Prelude.lc 25:22-25:23 V13 | 192 | testdata/Prelude.lc 25:22-25:23 V13 |
195 | testdata/Prelude.lc 25:24-25:25 V9 | 193 | testdata/Prelude.lc 25:24-25:25 V9 |
196 | testdata/Prelude.lc 27:2-27:5 {a} -> {b} -> {c} -> {d} -> a->c -> b->d -> (a, b)->(c, d) | 194 | testdata/Prelude.lc 27:2-27:5 {a} -> {b} -> {c} -> {d} -> a->c -> b->d -> (a, b)->(c, d) |
197 | testdata/Prelude.lc 27:12-27:16 V5 | ||
198 | testdata/Prelude.lc 27:12-27:30 (V1, V0) | ||
199 | testdata/Prelude.lc 27:20-27:30 (V1, V0) | HList V2 -> V2 | V2 -> HList V2 -> V2 | 195 | testdata/Prelude.lc 27:20-27:30 (V1, V0) | HList V2 -> V2 | V2 -> HList V2 -> V2 |
200 | testdata/Prelude.lc 27:21-27:22 V18 | 196 | testdata/Prelude.lc 27:21-27:22 V18 |
201 | testdata/Prelude.lc 27:23-27:24 V15 | 197 | testdata/Prelude.lc 27:23-27:24 V15 |
@@ -263,7 +259,7 @@ testdata/Prelude.lc 38:26-38:30 ((List V8)) | List V10 | |||
263 | testdata/Prelude.lc 38:27-38:28 {a} -> a -> List a -> List a | 259 | testdata/Prelude.lc 38:27-38:28 {a} -> a -> List a -> List a |
264 | testdata/Prelude.lc 38:28-38:30 List V5 | 260 | testdata/Prelude.lc 38:28-38:30 List V5 |
265 | testdata/Prelude.lc 39:10-39:12 HList V2 -> V2 | V10 | V2 -> HList V2 -> V2 | V3 | V7 | 261 | testdata/Prelude.lc 39:10-39:12 HList V2 -> V2 | V10 | V2 -> HList V2 -> V2 | V3 | V7 |
266 | testdata/Prelude.lc 39:10-39:15 (List V4, List V3) | (List V5, List V4) | V3 | 262 | testdata/Prelude.lc 39:10-39:15 (List V4, List V3) | (List V5, List V4) |
267 | testdata/Prelude.lc 39:13-39:15 HList V2 -> V2 | V2 | V2 -> HList V2 -> V2 | V5 | 263 | testdata/Prelude.lc 39:13-39:15 HList V2 -> V2 | V2 | V2 -> HList V2 -> V2 | V5 |
268 | testdata/Prelude.lc 39:19-39:24 {a} -> {b} -> List (a, b) -> (List a, List b) | 264 | testdata/Prelude.lc 39:19-39:24 {a} -> {b} -> List (a, b) -> (List a, List b) |
269 | testdata/Prelude.lc 39:19-39:27 (List V1, List V0) | 265 | testdata/Prelude.lc 39:19-39:27 (List V1, List V0) |
@@ -439,12 +435,8 @@ testdata/Prelude.lc 74:31-74:32 V2->V3 | |||
439 | testdata/Prelude.lc 74:31-74:34 V2 | 435 | testdata/Prelude.lc 74:31-74:34 V2 |
440 | testdata/Prelude.lc 74:33-74:34 V2 | 436 | testdata/Prelude.lc 74:33-74:34 V2 |
441 | testdata/Prelude.lc 76:1-76:4 {a} -> {b} -> (a, b)->a | 437 | testdata/Prelude.lc 76:1-76:4 {a} -> {b} -> (a, b)->a |
442 | testdata/Prelude.lc 76:6-76:10 V3 | ||
443 | testdata/Prelude.lc 76:6-76:15 V1 | ||
444 | testdata/Prelude.lc 76:14-76:15 HList V2 -> V2 | V10 | V2 -> HList V2 -> V2 | V3 | V7 | 438 | testdata/Prelude.lc 76:14-76:15 HList V2 -> V2 | V10 | V2 -> HList V2 -> V2 | V3 | V7 |
445 | testdata/Prelude.lc 77:1-77:4 {a} -> {b} -> (a, b)->b | 439 | testdata/Prelude.lc 77:1-77:4 {a} -> {b} -> (a, b)->b |
446 | testdata/Prelude.lc 77:6-77:10 V3 | ||
447 | testdata/Prelude.lc 77:6-77:15 V0 | ||
448 | testdata/Prelude.lc 77:14-77:15 HList V2 -> V2 | V2 | V2 -> HList V2 -> V2 | V5 | 440 | testdata/Prelude.lc 77:14-77:15 HList V2 -> V2 | V2 | V2 -> HList V2 -> V2 | V5 |
449 | testdata/Prelude.lc 79:1-79:6 V2 | 441 | testdata/Prelude.lc 79:1-79:6 V2 |
450 | testdata/Prelude.lc 79:1-80:18 Bool | 442 | testdata/Prelude.lc 79:1-80:18 Bool |
diff --git a/testdata/ambig.out b/testdata/ambig.out index c57a8352..2e7ae187 100644 --- a/testdata/ambig.out +++ b/testdata/ambig.out | |||
@@ -5,8 +5,6 @@ h :: [32m{a} -> {b} -> {c} -> {d} -> (b -> d->c) -> (b, d) -> a->c[39m[K | |||
5 | testdata/ambig.lc 4:1-4:2 {a} -> {b} -> {c} -> {d} -> (b -> d->c) -> (b, d) -> a->c | 5 | testdata/ambig.lc 4:1-4:2 {a} -> {b} -> {c} -> {d} -> (b -> d->c) -> (b, d) -> a->c |
6 | testdata/ambig.lc 4:11-4:12 V2 | 6 | testdata/ambig.lc 4:11-4:12 V2 |
7 | testdata/ambig.lc 7:9-7:29 V1 | 7 | testdata/ambig.lc 7:9-7:29 V1 |
8 | testdata/ambig.lc 7:12-7:16 V4 | ||
9 | testdata/ambig.lc 7:12-7:26 V1 | ||
10 | testdata/ambig.lc 7:21-7:22 V18 | 8 | testdata/ambig.lc 7:21-7:22 V18 |
11 | testdata/ambig.lc 7:21-7:26 HList V2 -> V2 | V2 | V2 -> HList V2 -> V2 | V3 | 9 | testdata/ambig.lc 7:21-7:26 HList V2 -> V2 | V2 | V2 -> HList V2 -> V2 | V3 |
12 | testdata/ambig.lc 7:23-7:24 V13 | 10 | testdata/ambig.lc 7:23-7:24 V13 |
diff --git a/testdata/record01.reject.out b/testdata/record01.reject.out index 84273e80..45f4046c 100644 --- a/testdata/record01.reject.out +++ b/testdata/record01.reject.out | |||
@@ -146,8 +146,6 @@ testdata/record01.reject.lc 16:40-16:53 Type | |||
146 | testdata/record01.reject.lc 16:44-16:45 V1 | 146 | testdata/record01.reject.lc 16:44-16:45 V1 |
147 | testdata/record01.reject.lc 16:46-16:47 V1 | 147 | testdata/record01.reject.lc 16:46-16:47 V1 |
148 | testdata/record01.reject.lc 16:48-16:53 Type | 148 | testdata/record01.reject.lc 16:48-16:53 Type |
149 | testdata/record01.reject.lc 17:18-17:19 V1 | ||
150 | testdata/record01.reject.lc 17:18-17:61 (VecS Float 4, VecS Float 4) | ||
151 | testdata/record01.reject.lc 17:27-17:61 (VecS Float 4, VecS Float 4) | HList V2 -> V2 | V2 -> HList V2 -> V2 | 149 | testdata/record01.reject.lc 17:27-17:61 (VecS Float 4, VecS Float 4) | HList V2 -> V2 | V2 -> HList V2 -> V2 |
152 | testdata/record01.reject.lc 17:28-17:41 {a:Nat} -> {b:Nat} -> {c} -> Mat a b c -> Vec b c -> Vec a c | 150 | testdata/record01.reject.lc 17:28-17:41 {a:Nat} -> {b:Nat} -> {c} -> Mat a b c -> Vec b c -> Vec a c |
153 | testdata/record01.reject.lc 17:28-17:55 Vec 4 Float -> Vec 4 Float | 151 | testdata/record01.reject.lc 17:28-17:55 Vec 4 Float -> Vec 4 Float |
@@ -182,8 +180,6 @@ testdata/record01.reject.lc 20:43-20:52 {a} -> RasterContext a 'Triangle | |||
182 | testdata/record01.reject.lc 20:53-20:63 ((Interpolated V2)) | 180 | testdata/record01.reject.lc 20:53-20:63 ((Interpolated V2)) |
183 | testdata/record01.reject.lc 20:55-20:61 {a} -> {b : Floating a} -> Interpolated a | 181 | testdata/record01.reject.lc 20:55-20:61 {a} -> {b : Floating a} -> Interpolated a |
184 | testdata/record01.reject.lc 20:64-20:79 {a:PrimitiveType} -> List (Primitive (VecS Float 4, VecS Float 4) a) | 182 | testdata/record01.reject.lc 20:64-20:79 {a:PrimitiveType} -> List (Primitive (VecS Float 4, VecS Float 4) a) |
185 | testdata/record01.reject.lc 21:26-21:27 V2 | ||
186 | testdata/record01.reject.lc 21:26-21:55 ((VecS Float 4)) | ||
187 | testdata/record01.reject.lc 21:33-21:55 ((VecS Float 4)) | HList V2 -> V2 | V2 -> HList V2 -> V2 | 183 | testdata/record01.reject.lc 21:33-21:55 ((VecS Float 4)) | HList V2 -> V2 | V2 -> HList V2 -> V2 |
188 | testdata/record01.reject.lc 21:35-21:37 {a} -> a -> a -> a -> a -> VecS a 4 | 184 | testdata/record01.reject.lc 21:35-21:37 {a} -> a -> a -> a -> a -> VecS a 4 |
189 | testdata/record01.reject.lc 21:35-21:41 Float -> Float -> Float -> VecS Float 4 | 185 | testdata/record01.reject.lc 21:35-21:41 Float -> Float -> Float -> VecS Float 4 |
@@ -194,8 +190,6 @@ testdata/record01.reject.lc 21:38-21:41 Float | |||
194 | testdata/record01.reject.lc 21:42-21:45 Float | 190 | testdata/record01.reject.lc 21:42-21:45 Float |
195 | testdata/record01.reject.lc 21:46-21:49 Float | 191 | testdata/record01.reject.lc 21:46-21:49 Float |
196 | testdata/record01.reject.lc 21:50-21:53 Float | 192 | testdata/record01.reject.lc 21:50-21:53 Float |
197 | testdata/record01.reject.lc 22:26-22:27 V1 | ||
198 | testdata/record01.reject.lc 22:26-22:67 ((VecS Float 4)) | ||
199 | testdata/record01.reject.lc 22:33-22:67 ((VecS Float 4)) | HList V2 -> V2 | V2 -> HList V2 -> V2 | 193 | testdata/record01.reject.lc 22:33-22:67 ((VecS Float 4)) | HList V2 -> V2 | V2 -> HList V2 -> V2 |
200 | testdata/record01.reject.lc 22:35-22:42 {a} -> {b : Num (MatVecScalarElem a)} -> a -> a->a | 194 | testdata/record01.reject.lc 22:35-22:42 {a} -> {b : Num (MatVecScalarElem a)} -> a -> a->a |
201 | testdata/record01.reject.lc 22:35-22:44 V8->V9 | 195 | testdata/record01.reject.lc 22:35-22:44 V8->V9 |