summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--TODO5
-rw-r--r--src/LambdaCube/Compiler/Parser.hs28
-rw-r--r--testdata/Builtins.out4
-rw-r--r--testdata/HList/Builtins.out4
-rw-r--r--testdata/HList/Internals.out39
-rw-r--r--testdata/Internals.out39
-rw-r--r--testdata/typeclass.out6
7 files changed, 59 insertions, 66 deletions
diff --git a/TODO b/TODO
index ceb283ce..e43fe487 100644
--- a/TODO
+++ b/TODO
@@ -92,10 +92,10 @@ done:
92 92
93next: 93next:
94- mutual recursion (inference & reduction) 94- mutual recursion (inference & reduction)
95- compiler optimization: irrelevance + erasure
96- re-enable ambiguity checks 95- re-enable ambiguity checks
97- show desugared source code on a tab in the editor 96- show desugared source code on a tab in the editor
98- names should have unique identifiers 97- names should have unique identifiers
98- compiler optimization: HOAS iterpreter
99 99
100- backend: array support 100- backend: array support
101 101
@@ -173,6 +173,7 @@ extra (refactoring):
173- review all old disabled test cases 173- review all old disabled test cases
174- 100% test coverage of the parser 174- 100% test coverage of the parser
175- tail recursion -> GPU 175- tail recursion -> GPU
176- compiler optimization: irrelevance + erasure
176 177
177------------------------------------------------------------------- week Mar 7 178------------------------------------------------------------------- week Mar 7
178-- padding week 179-- padding week
@@ -299,3 +300,5 @@ reviews, blogs
299insert somewhere 300insert somewhere
300- editor: input editor (add/edit new uniform values e.g. floats, matrixes and textures if possible) 301- editor: input editor (add/edit new uniform values e.g. floats, matrixes and textures if possible)
301- testenv: create comparison charts from the results 302- testenv: create comparison charts from the results
303- measure shader performance
304
diff --git a/src/LambdaCube/Compiler/Parser.hs b/src/LambdaCube/Compiler/Parser.hs
index 283638de..6a27fb56 100644
--- a/src/LambdaCube/Compiler/Parser.hs
+++ b/src/LambdaCube/Compiler/Parser.hs
@@ -459,7 +459,7 @@ parseTerm prec = setSI' {-TODO: remove, slow-} $ case prec of
459 ]) 459 ])
460 `SAppV` exp 460 `SAppV` exp
461 461
462 letdecl = mkLets <$ reserved "let" <*> dsInfo <*> (compileFunAlts' SLabelEnd =<< valueDef) 462 letdecl = mkLets <$ reserved "let" <*> dsInfo <*> (compileFunAlts' =<< valueDef)
463 463
464 boolExpression = (\pred e -> SBuiltin "primIfThenElse" `SAppV` pred `SAppV` e `SAppV` SBuiltin "Nil") <$> parseTerm PrecLam 464 boolExpression = (\pred e -> SBuiltin "primIfThenElse" `SAppV` pred `SAppV` e `SAppV` SBuiltin "Nil") <$> parseTerm PrecLam
465 465
@@ -658,8 +658,8 @@ compilePatts ps gu = cp [] ps
658 vs' = map (fromMaybe 0) vs_ 658 vs' = map (fromMaybe 0) vs_
659 s = sum vs 659 s = sum vs
660 660
661compileGuardTrees False ulend lend ge alts = compileGuardTree ulend lend ge $ Alts alts 661compileGuardTrees ulend ge alts = compileGuardTree ulend SLabelEnd ge $ Alts alts
662compileGuardTrees True ulend lend ge alts = foldr1 (SAppV2 $ SBuiltin "parEval" `SAppV` Wildcard SType) $ compileGuardTree ulend lend ge <$> alts 662compileGuardTrees' ge alts = foldr1 (SAppV2 $ SBuiltin "parEval" `SAppV` Wildcard SType) $ compileGuardTree id SLabelEnd ge <$> alts
663 663
664compileGuardTree :: (SExp -> SExp) -> (SExp -> SExp) -> DesugarInfo -> GuardTree -> SExp 664compileGuardTree :: (SExp -> SExp) -> (SExp -> SExp) -> DesugarInfo -> GuardTree -> SExp
665compileGuardTree ulend lend adts t = (\x -> traceD (" ! :" ++ ppShow x) x) $ guardTreeToCases t 665compileGuardTree ulend lend adts t = (\x -> traceD (" ! :" ++ ppShow x) x) $ guardTreeToCases t
@@ -772,7 +772,7 @@ parseDef =
772 (nps, args) <- telescopePat 772 (nps, args) <- telescopePat
773 checkPattern nps 773 checkPattern nps
774 cs <- expNS $ option [] $ reserved "where" *> indentMS False (dbFunAlt nps <$> funAltDef varId) 774 cs <- expNS $ option [] $ reserved "where" *> indentMS False (dbFunAlt nps <$> funAltDef varId)
775 pure . Instance x ({-todo-}map snd args) (dbff (nps <> [x]) <$> constraints) <$> compileFunAlts' id{-TODO-} cs 775 pure . Instance x ({-todo-}map snd args) (dbff (nps <> [x]) <$> constraints) <$> compileFunAlts' cs
776 <|> do indentation (try "type family" $ reserved "type" >> reserved "family") $ typeNS $ do 776 <|> do indentation (try "type family" $ reserved "type" >> reserved "family") $ typeNS $ do
777 x <- upperCase 777 x <- upperCase
778 (nps, ts) <- telescope (Just SType) 778 (nps, ts) <- telescope (Just SType)
@@ -780,13 +780,13 @@ parseDef =
780 option {-open type family-}[TypeFamily x ts t] $ do 780 option {-open type family-}[TypeFamily x ts t] $ do
781 cs <- (reserved "where" >>) $ indentMS True $ funAltDef $ mfilter (== x) upperCase 781 cs <- (reserved "where" >>) $ indentMS True $ funAltDef $ mfilter (== x) upperCase
782 -- closed type family desugared here 782 -- closed type family desugared here
783 compileFunAlts False id SLabelEnd [TypeAnn x $ addParamsS ts t] cs 783 compileFunAlts (compileGuardTrees id) [TypeAnn x $ addParamsS ts t] cs
784 <|> do indentation (try "type instance" $ reserved "type" >> reserved "instance") $ typeNS $ pure <$> funAltDef upperCase 784 <|> do indentation (try "type instance" $ reserved "type" >> reserved "instance") $ typeNS $ pure <$> funAltDef upperCase
785 <|> do indentation (reserved "type") $ typeNS $ do 785 <|> do indentation (reserved "type") $ typeNS $ do
786 x <- upperCase 786 x <- upperCase
787 (nps, ts) <- telescope $ Just (Wildcard SType) 787 (nps, ts) <- telescope $ Just (Wildcard SType)
788 rhs <- dbf' nps <$ reservedOp "=" <*> parseTerm PrecLam 788 rhs <- dbf' nps <$ reservedOp "=" <*> parseTerm PrecLam
789 compileFunAlts False id SLabelEnd 789 compileFunAlts (compileGuardTrees id)
790 [{-TypeAnn x $ addParamsS ts $ SType-}{-todo-}] 790 [{-TypeAnn x $ addParamsS ts $ SType-}{-todo-}]
791 [FunAlt x (zip ts $ map PVar $ reverse nps) $ Right rhs] 791 [FunAlt x (zip ts $ map PVar $ reverse nps) $ Right rhs]
792 <|> do try "typed ident" $ (\(vs, t) -> TypeAnn <$> vs <*> pure t) <$> typedIds Nothing 792 <|> do try "typed ident" $ (\(vs, t) -> TypeAnn <$> vs <*> pure t) <$> typedIds Nothing
@@ -813,7 +813,7 @@ parseRHS fe tok = fmap (fmap (fe *** fe) +++ fe) $ do
813 f <- option id $ mkLets <$ reserved "where" <*> dsInfo <*> parseDefs 813 f <- option id $ mkLets <$ reserved "where" <*> dsInfo <*> parseDefs
814 return $ Right $ f rhs 814 return $ Right $ f rhs
815 815
816parseDefs = indentMS True parseDef >>= compileFunAlts' SLabelEnd . concat 816parseDefs = indentMS True parseDef >>= compileFunAlts' . concat
817 817
818funAltDef parseName = do -- todo: use ns to determine parseName 818funAltDef parseName = do -- todo: use ns to determine parseName
819 (n, (fee, tss)) <- 819 (n, (fee, tss)) <-
@@ -926,25 +926,25 @@ desugarMutual ds xs = xs
926-} 926-}
927 927
928 928
929compileFunAlts' lend ds = fmap concat . sequence $ map (compileFunAlts False lend lend ds) $ groupBy h ds where 929compileFunAlts' ds = fmap concat . sequence $ map (compileFunAlts (compileGuardTrees SLabelEnd) ds) $ groupBy h ds where
930 h (FunAlt n _ _) (FunAlt m _ _) = m == n 930 h (FunAlt n _ _) (FunAlt m _ _) = m == n
931 h _ _ = False 931 h _ _ = False
932 932
933--compileFunAlts :: forall m . Monad m => Bool -> (SExp -> SExp) -> (SExp -> SExp) -> DesugarInfo -> [Stmt] -> [Stmt] -> m [Stmt] 933--compileFunAlts :: forall m . Monad m => Bool -> (SExp -> SExp) -> (SExp -> SExp) -> DesugarInfo -> [Stmt] -> [Stmt] -> m [Stmt]
934compileFunAlts par ulend lend ds xs = dsInfo >>= \ge -> case xs of 934compileFunAlts compilegt ds xs = dsInfo >>= \ge -> case xs of
935 [Instance{}] -> return [] 935 [Instance{}] -> return []
936 [Class n ps ms] -> do 936 [Class n ps ms] -> do
937 cd <- compileFunAlts' SLabelEnd $ 937 cd <- compileFunAlts' $
938 [ TypeAnn n $ foldr (SPi Visible) SType ps ] 938 [ TypeAnn n $ foldr (SPi Visible) SType ps ]
939 ++ [ FunAlt n (map noTA ps) $ Right $ foldr (SAppV2 $ SBuiltin "'T2") (SBuiltin "'Unit") cstrs | Instance n' ps cstrs _ <- ds, n == n' ] 939 ++ [ FunAlt n (map noTA ps) $ Right $ foldr (SAppV2 $ SBuiltin "'T2") (SBuiltin "'Unit") cstrs | Instance n' ps cstrs _ <- ds, n == n' ]
940 ++ [ FunAlt n (replicate (length ps) (noTA $ PVar (debugSI "compileFunAlts1", "generated_name0"))) $ Right $ SBuiltin "'Empty" `SAppV` sLit (LString $ "no instance of " ++ snd n ++ " on ???")] 940 ++ [ FunAlt n (replicate (length ps) (noTA $ PVar (debugSI "compileFunAlts1", "generated_name0"))) $ Right $ SBuiltin "'Empty" `SAppV` sLit (LString $ "no instance of " ++ snd n ++ " on ???")]
941 cds <- sequence 941 cds <- sequence
942 [ compileFunAlts' SLabelEnd 942 [ compileFunAlts'
943 $ TypeAnn m (addParamsS (map ((,) Hidden) ps) $ SPi Hidden (foldl SAppV (SGlobal n) $ downToS "a2" 0 $ length ps) $ up1 t) 943 $ TypeAnn m (addParamsS (map ((,) Hidden) ps) $ SPi Hidden (foldl SAppV (SGlobal n) $ downToS "a2" 0 $ length ps) $ up1 t)
944 : as 944 : as
945 | (m, t) <- ms 945 | (m, t) <- ms
946-- , let ts = fst $ getParamsS $ up1 t 946-- , let ts = fst $ getParamsS $ up1 t
947 , let as = [ FunAlt m p $ Right {- $ SLam Hidden (Wildcard SType) $ up1 -} e 947 , let as = [ FunAlt m p $ Right {- $ SLam Hidden (Wildcard SType) $ up1 -} $ SLet m' e $ SVar mempty 0
948 | Instance n' i cstrs alts <- ds, n' == n 948 | Instance n' i cstrs alts <- ds, n' == n
949 , Let m' ~Nothing ~Nothing e <- alts, m' == m 949 , Let m' ~Nothing ~Nothing e <- alts, m' == m
950 , let p = zip ((,) Hidden <$> ps) i ++ [((Hidden, Wildcard SType), PVar (mempty, ""))] 950 , let p = zip ((,) Hidden <$> ps) i ++ [((Hidden, Wildcard SType), PVar (mempty, ""))]
@@ -955,7 +955,7 @@ compileFunAlts par ulend lend ds xs = dsInfo >>= \ge -> case xs of
955 [TypeAnn n t] -> return [Primitive n Nothing t | snd n `notElem` [n' | FunAlt (_, n') _ _ <- ds]] 955 [TypeAnn n t] -> return [Primitive n Nothing t | snd n `notElem` [n' | FunAlt (_, n') _ _ <- ds]]
956 tf@[TypeFamily n ps t] -> case [d | d@(FunAlt n' _ _) <- ds, n' == n] of 956 tf@[TypeFamily n ps t] -> case [d | d@(FunAlt n' _ _) <- ds, n' == n] of
957 [] -> return [Primitive n Nothing $ addParamsS ps t] 957 [] -> return [Primitive n Nothing $ addParamsS ps t]
958 alts -> compileFunAlts True id SLabelEnd [TypeAnn n $ addParamsS ps t] alts 958 alts -> compileFunAlts compileGuardTrees' [TypeAnn n $ addParamsS ps t] alts
959 [p@PrecDef{}] -> return [p] 959 [p@PrecDef{}] -> return [p]
960 fs@(FunAlt n vs _: _) -> case map head $ group [length vs | FunAlt _ vs _ <- fs] of 960 fs@(FunAlt n vs _: _) -> case map head $ group [length vs | FunAlt _ vs _ <- fs] of
961 [num] 961 [num]
@@ -965,7 +965,7 @@ compileFunAlts par ulend lend ds xs = dsInfo >>= \ge -> case xs of
965 [ Let n 965 [ Let n
966 (listToMaybe [t | PrecDef n' t <- ds, n' == n]) 966 (listToMaybe [t | PrecDef n' t <- ds, n' == n])
967 (listToMaybe [t | TypeAnn n' t <- ds, n' == n]) 967 (listToMaybe [t | TypeAnn n' t <- ds, n' == n])
968 $ foldr (uncurry SLam . fst) (compileGuardTrees par ulend lend ge 968 $ foldr (uncurry SLam . fst) (compilegt ge
969 [ compilePatts (zip (map snd vs) $ reverse [0.. num - 1]) gsx 969 [ compilePatts (zip (map snd vs) $ reverse [0.. num - 1]) gsx
970 | FunAlt _ vs gsx <- fs 970 | FunAlt _ vs gsx <- fs
971 ]) vs 971 ]) vs
diff --git a/testdata/Builtins.out b/testdata/Builtins.out
index bc06d1b4..649aa4f4 100644
--- a/testdata/Builtins.out
+++ b/testdata/Builtins.out
@@ -917,10 +917,8 @@ testdata/Builtins.lc 94:20-112:24 Type | Type->Type
917testdata/Builtins.lc 94:20-122:40 V1 | {a : Component V0}->V1 | {a} -> {b : Component a}->a 917testdata/Builtins.lc 94:20-122:40 V1 | {a : Component V0}->V1 | {a} -> {b : Component a}->a
918testdata/Builtins.lc 94:20-123:35 V1 | {a : Component V0}->V1 | {a} -> {b : Component a}->a 918testdata/Builtins.lc 94:20-123:35 V1 | {a : Component V0}->V1 | {a} -> {b : Component a}->a
919testdata/Builtins.lc 95:14-95:15 V1 919testdata/Builtins.lc 95:14-95:15 V1
920testdata/Builtins.lc 95:14-95:22 Int
921testdata/Builtins.lc 95:19-95:22 Type 920testdata/Builtins.lc 95:19-95:22 Type
922testdata/Builtins.lc 96:13-96:14 V1 921testdata/Builtins.lc 96:13-96:14 V1
923testdata/Builtins.lc 96:13-96:21 Int
924testdata/Builtins.lc 96:18-96:21 Type 922testdata/Builtins.lc 96:18-96:21 Type
925testdata/Builtins.lc 97:20-97:24 Type 923testdata/Builtins.lc 97:20-97:24 Type
926testdata/Builtins.lc 97:20-98:23 V1->V2 924testdata/Builtins.lc 97:20-98:23 V1->V2
@@ -929,10 +927,8 @@ testdata/Builtins.lc 97:20-112:24 Type
929testdata/Builtins.lc 97:20-122:40 V1 927testdata/Builtins.lc 97:20-122:40 V1
930testdata/Builtins.lc 97:20-123:35 V1 928testdata/Builtins.lc 97:20-123:35 V1
931testdata/Builtins.lc 98:14-98:15 V1 929testdata/Builtins.lc 98:14-98:15 V1
932testdata/Builtins.lc 98:14-98:23 Word
933testdata/Builtins.lc 98:19-98:23 Type 930testdata/Builtins.lc 98:19-98:23 Type
934testdata/Builtins.lc 99:13-99:14 V1 931testdata/Builtins.lc 99:13-99:14 V1
935testdata/Builtins.lc 99:13-99:22 Word
936testdata/Builtins.lc 99:18-99:22 Type 932testdata/Builtins.lc 99:18-99:22 Type
937testdata/Builtins.lc 100:20-100:25 Type 933testdata/Builtins.lc 100:20-100:25 Type
938testdata/Builtins.lc 100:20-101:17 V1->V2 934testdata/Builtins.lc 100:20-101:17 V1->V2
diff --git a/testdata/HList/Builtins.out b/testdata/HList/Builtins.out
index c6777483..9c8a6bcd 100644
--- a/testdata/HList/Builtins.out
+++ b/testdata/HList/Builtins.out
@@ -922,10 +922,8 @@ testdata/HList/Builtins.lc 95:20-113:24 Type | Type->Type
922testdata/HList/Builtins.lc 95:20-123:40 V1 | {a : Component V0}->V1 | {a} -> {b : Component a}->a 922testdata/HList/Builtins.lc 95:20-123:40 V1 | {a : Component V0}->V1 | {a} -> {b : Component a}->a
923testdata/HList/Builtins.lc 95:20-124:35 V1 | {a : Component V0}->V1 | {a} -> {b : Component a}->a 923testdata/HList/Builtins.lc 95:20-124:35 V1 | {a : Component V0}->V1 | {a} -> {b : Component a}->a
924testdata/HList/Builtins.lc 96:14-96:15 V1 924testdata/HList/Builtins.lc 96:14-96:15 V1
925testdata/HList/Builtins.lc 96:14-96:22 Int
926testdata/HList/Builtins.lc 96:19-96:22 Type 925testdata/HList/Builtins.lc 96:19-96:22 Type
927testdata/HList/Builtins.lc 97:13-97:14 V1 926testdata/HList/Builtins.lc 97:13-97:14 V1
928testdata/HList/Builtins.lc 97:13-97:21 Int
929testdata/HList/Builtins.lc 97:18-97:21 Type 927testdata/HList/Builtins.lc 97:18-97:21 Type
930testdata/HList/Builtins.lc 98:20-98:24 Type 928testdata/HList/Builtins.lc 98:20-98:24 Type
931testdata/HList/Builtins.lc 98:20-99:23 V1->V2 929testdata/HList/Builtins.lc 98:20-99:23 V1->V2
@@ -934,10 +932,8 @@ testdata/HList/Builtins.lc 98:20-113:24 Type
934testdata/HList/Builtins.lc 98:20-123:40 V1 932testdata/HList/Builtins.lc 98:20-123:40 V1
935testdata/HList/Builtins.lc 98:20-124:35 V1 933testdata/HList/Builtins.lc 98:20-124:35 V1
936testdata/HList/Builtins.lc 99:14-99:15 V1 934testdata/HList/Builtins.lc 99:14-99:15 V1
937testdata/HList/Builtins.lc 99:14-99:23 Word
938testdata/HList/Builtins.lc 99:19-99:23 Type 935testdata/HList/Builtins.lc 99:19-99:23 Type
939testdata/HList/Builtins.lc 100:13-100:14 V1 936testdata/HList/Builtins.lc 100:13-100:14 V1
940testdata/HList/Builtins.lc 100:13-100:22 Word
941testdata/HList/Builtins.lc 100:18-100:22 Type 937testdata/HList/Builtins.lc 100:18-100:22 Type
942testdata/HList/Builtins.lc 101:20-101:25 Type 938testdata/HList/Builtins.lc 101:20-101:25 Type
943testdata/HList/Builtins.lc 101:20-102:17 V1->V2 939testdata/HList/Builtins.lc 101:20-102:17 V1->V2
diff --git a/testdata/HList/Internals.out b/testdata/HList/Internals.out
index 665280b4..0c4bd2c0 100644
--- a/testdata/HList/Internals.out
+++ b/testdata/HList/Internals.out
@@ -292,8 +292,7 @@ testdata/HList/Internals.lc 84:14-96:17 Type | Type->Type
292testdata/HList/Internals.lc 84:14-97:25 Int->V2 | {a : Num V0} -> Int->V2 | {a} -> {b : Num a} -> Int->a 292testdata/HList/Internals.lc 84:14-97:25 Int->V2 | {a : Num V0} -> Int->V2 | {a} -> {b : Num a} -> Int->a
293testdata/HList/Internals.lc 84:14-98:22 V1 -> V2->Ordering | {a : Num V0} -> V1 -> V2->Ordering | {a} -> {b : Num a} -> a -> a->Ordering 293testdata/HList/Internals.lc 84:14-98:22 V1 -> V2->Ordering | {a : Num V0} -> V1 -> V2->Ordering | {a} -> {b : Num a} -> a -> a->Ordering
294testdata/HList/Internals.lc 84:14-99:22 V1->V2 | {a : Num V0} -> V1->V2 | {a} -> {b : Num a} -> a->a 294testdata/HList/Internals.lc 84:14-99:22 V1->V2 | {a : Num V0} -> V1->V2 | {a} -> {b : Num a} -> a->a
295testdata/HList/Internals.lc 85:13-85:20 Int->Int 295testdata/HList/Internals.lc 85:19-85:20 V1
296testdata/HList/Internals.lc 85:19-85:20 Int
297testdata/HList/Internals.lc 86:13-86:27 Int -> Int->Ordering 296testdata/HList/Internals.lc 86:13-86:27 Int -> Int->Ordering
298testdata/HList/Internals.lc 87:13-87:26 Int->Int 297testdata/HList/Internals.lc 87:13-87:26 Int->Int
299testdata/HList/Internals.lc 88:14-88:18 Type 298testdata/HList/Internals.lc 88:14-88:18 Type
@@ -339,65 +338,65 @@ testdata/HList/Internals.lc 106:13-106:63 (V1 -> V2->Bool) -> V2 -> V3->Bool
339testdata/HList/Internals.lc 106:13-114:16 Type | Type->Type 338testdata/HList/Internals.lc 106:13-114:16 Type | Type->Type
340testdata/HList/Internals.lc 106:13-117:29 V1 -> V2->Bool | {a : Eq V0} -> V1 -> V2->Bool | {a} -> {b : Eq a} -> a -> a->Bool 339testdata/HList/Internals.lc 106:13-117:29 V1 -> V2->Bool | {a : Eq V0} -> V1 -> V2->Bool | {a} -> {b : Eq a} -> a -> a->Bool
341testdata/HList/Internals.lc 106:35-106:39 Ordering->Bool 340testdata/HList/Internals.lc 106:35-106:39 Ordering->Bool
342testdata/HList/Internals.lc 106:35-106:63 Bool | String -> String->Bool | String->Bool 341testdata/HList/Internals.lc 106:35-106:63 Bool
343testdata/HList/Internals.lc 106:40-106:63 Ordering 342testdata/HList/Internals.lc 106:40-106:63 Ordering
344testdata/HList/Internals.lc 106:41-106:58 String -> String->Ordering 343testdata/HList/Internals.lc 106:41-106:58 String -> String->Ordering
345testdata/HList/Internals.lc 106:41-106:60 String->Ordering 344testdata/HList/Internals.lc 106:41-106:60 String->Ordering
346testdata/HList/Internals.lc 106:59-106:60 String 345testdata/HList/Internals.lc 106:59-106:60 V3
347testdata/HList/Internals.lc 106:61-106:62 String 346testdata/HList/Internals.lc 106:61-106:62 V1
348testdata/HList/Internals.lc 107:13-107:17 Type 347testdata/HList/Internals.lc 107:13-107:17 Type
349testdata/HList/Internals.lc 107:13-107:59 (V1 -> V2->Bool) -> V2 -> V3->Bool 348testdata/HList/Internals.lc 107:13-107:59 (V1 -> V2->Bool) -> V2 -> V3->Bool
350testdata/HList/Internals.lc 107:13-114:16 Type 349testdata/HList/Internals.lc 107:13-114:16 Type
351testdata/HList/Internals.lc 107:13-117:29 V1 -> V2->Bool 350testdata/HList/Internals.lc 107:13-117:29 V1 -> V2->Bool
352testdata/HList/Internals.lc 107:33-107:37 Ordering->Bool 351testdata/HList/Internals.lc 107:33-107:37 Ordering->Bool
353testdata/HList/Internals.lc 107:33-107:59 Bool | Char -> Char->Bool | Char->Bool 352testdata/HList/Internals.lc 107:33-107:59 Bool
354testdata/HList/Internals.lc 107:38-107:59 Ordering 353testdata/HList/Internals.lc 107:38-107:59 Ordering
355testdata/HList/Internals.lc 107:39-107:54 Char -> Char->Ordering 354testdata/HList/Internals.lc 107:39-107:54 Char -> Char->Ordering
356testdata/HList/Internals.lc 107:39-107:56 Char->Ordering 355testdata/HList/Internals.lc 107:39-107:56 Char->Ordering
357testdata/HList/Internals.lc 107:55-107:56 Char 356testdata/HList/Internals.lc 107:55-107:56 V3
358testdata/HList/Internals.lc 107:57-107:58 Char 357testdata/HList/Internals.lc 107:57-107:58 V1
359testdata/HList/Internals.lc 108:13-108:16 Type 358testdata/HList/Internals.lc 108:13-108:16 Type
360testdata/HList/Internals.lc 108:13-108:57 (V1 -> V2->Bool) -> V2 -> V3->Bool 359testdata/HList/Internals.lc 108:13-108:57 (V1 -> V2->Bool) -> V2 -> V3->Bool
361testdata/HList/Internals.lc 108:13-114:16 Type 360testdata/HList/Internals.lc 108:13-114:16 Type
362testdata/HList/Internals.lc 108:13-117:29 V1 -> V2->Bool 361testdata/HList/Internals.lc 108:13-117:29 V1 -> V2->Bool
363testdata/HList/Internals.lc 108:32-108:36 Ordering->Bool 362testdata/HList/Internals.lc 108:32-108:36 Ordering->Bool
364testdata/HList/Internals.lc 108:32-108:57 Bool | Int -> Int->Bool | Int->Bool 363testdata/HList/Internals.lc 108:32-108:57 Bool
365testdata/HList/Internals.lc 108:37-108:57 Ordering 364testdata/HList/Internals.lc 108:37-108:57 Ordering
366testdata/HList/Internals.lc 108:38-108:52 Int -> Int->Ordering 365testdata/HList/Internals.lc 108:38-108:52 Int -> Int->Ordering
367testdata/HList/Internals.lc 108:38-108:54 Int->Ordering 366testdata/HList/Internals.lc 108:38-108:54 Int->Ordering
368testdata/HList/Internals.lc 108:53-108:54 Int 367testdata/HList/Internals.lc 108:53-108:54 V3
369testdata/HList/Internals.lc 108:55-108:56 Int 368testdata/HList/Internals.lc 108:55-108:56 V1
370testdata/HList/Internals.lc 109:13-109:18 Type 369testdata/HList/Internals.lc 109:13-109:18 Type
371testdata/HList/Internals.lc 109:13-109:61 (V1 -> V2->Bool) -> V2 -> V3->Bool 370testdata/HList/Internals.lc 109:13-109:61 (V1 -> V2->Bool) -> V2 -> V3->Bool
372testdata/HList/Internals.lc 109:13-114:16 Type 371testdata/HList/Internals.lc 109:13-114:16 Type
373testdata/HList/Internals.lc 109:13-117:29 V1 -> V2->Bool 372testdata/HList/Internals.lc 109:13-117:29 V1 -> V2->Bool
374testdata/HList/Internals.lc 109:34-109:38 Ordering->Bool 373testdata/HList/Internals.lc 109:34-109:38 Ordering->Bool
375testdata/HList/Internals.lc 109:34-109:61 Bool | Float -> Float->Bool | Float->Bool 374testdata/HList/Internals.lc 109:34-109:61 Bool
376testdata/HList/Internals.lc 109:39-109:61 Ordering 375testdata/HList/Internals.lc 109:39-109:61 Ordering
377testdata/HList/Internals.lc 109:40-109:56 Float -> Float->Ordering 376testdata/HList/Internals.lc 109:40-109:56 Float -> Float->Ordering
378testdata/HList/Internals.lc 109:40-109:58 Float->Ordering 377testdata/HList/Internals.lc 109:40-109:58 Float->Ordering
379testdata/HList/Internals.lc 109:57-109:58 Float 378testdata/HList/Internals.lc 109:57-109:58 V3
380testdata/HList/Internals.lc 109:59-109:60 Float 379testdata/HList/Internals.lc 109:59-109:60 V1
381testdata/HList/Internals.lc 110:13-110:17 Type 380testdata/HList/Internals.lc 110:13-110:17 Type
382testdata/HList/Internals.lc 110:13-113:19 (V1 -> V2->Bool) -> V2 -> V3->Bool 381testdata/HList/Internals.lc 110:13-113:19 (V1 -> V2->Bool) -> V2 -> V3->Bool
383testdata/HList/Internals.lc 110:13-114:16 Type 382testdata/HList/Internals.lc 110:13-114:16 Type
384testdata/HList/Internals.lc 110:13-117:29 V1 -> V2->Bool 383testdata/HList/Internals.lc 110:13-117:29 V1 -> V2->Bool
385testdata/HList/Internals.lc 111:5-111:9 Bool 384testdata/HList/Internals.lc 111:5-111:9 V2
386testdata/HList/Internals.lc 111:5-113:19 Bool | Bool -> Bool->Bool | Bool->Bool 385testdata/HList/Internals.lc 111:5-113:19 Bool
387testdata/HList/Internals.lc 111:13-111:17 Bool 386testdata/HList/Internals.lc 111:13-111:17 Bool
388testdata/HList/Internals.lc 111:13-113:19 Bool 387testdata/HList/Internals.lc 111:13-113:19 Bool
389testdata/HList/Internals.lc 111:20-111:24 Bool 388testdata/HList/Internals.lc 111:20-111:24 Bool
390testdata/HList/Internals.lc 111:20-113:19 Bool->Bool 389testdata/HList/Internals.lc 111:20-113:19 Bool->Bool
391testdata/HList/Internals.lc 112:14-112:19 Bool 390testdata/HList/Internals.lc 112:14-112:19 V1
392testdata/HList/Internals.lc 112:14-113:19 Bool 391testdata/HList/Internals.lc 112:14-113:19 Bool
393testdata/HList/Internals.lc 112:22-112:26 Bool 392testdata/HList/Internals.lc 112:22-112:26 Bool
394testdata/HList/Internals.lc 112:22-113:19 Bool->Bool 393testdata/HList/Internals.lc 112:22-113:19 Bool->Bool
395testdata/HList/Internals.lc 113:14-113:19 Bool 394testdata/HList/Internals.lc 113:14-113:19 Bool
396testdata/HList/Internals.lc 114:13-114:16 Type 395testdata/HList/Internals.lc 114:13-114:16 Type
397testdata/HList/Internals.lc 114:13-117:29 (V1 -> V2->Bool) -> V2 -> V3->Bool 396testdata/HList/Internals.lc 114:13-117:29 (V1 -> V2->Bool) -> V2 -> V3->Bool
398testdata/HList/Internals.lc 115:5-115:9 Nat 397testdata/HList/Internals.lc 115:5-115:9 V2
399testdata/HList/Internals.lc 115:5-117:29 Bool | Nat -> Nat->Bool | Nat->Bool 398testdata/HList/Internals.lc 115:5-117:29 Bool
400testdata/HList/Internals.lc 115:15-115:19 Nat 399testdata/HList/Internals.lc 115:15-115:19 V1
401testdata/HList/Internals.lc 115:15-117:29 Bool 400testdata/HList/Internals.lc 115:15-117:29 Bool
402testdata/HList/Internals.lc 115:24-115:28 Bool 401testdata/HList/Internals.lc 115:24-115:28 Bool
403testdata/HList/Internals.lc 115:24-117:29 Nat->Bool 402testdata/HList/Internals.lc 115:24-117:29 Nat->Bool
diff --git a/testdata/Internals.out b/testdata/Internals.out
index 24ef594c..a85035e3 100644
--- a/testdata/Internals.out
+++ b/testdata/Internals.out
@@ -373,8 +373,7 @@ testdata/Internals.lc 108:14-120:17 Type | Type->Type
373testdata/Internals.lc 108:14-121:25 Int->V2 | {a : Num V0} -> Int->V2 | {a} -> {b : Num a} -> Int->a 373testdata/Internals.lc 108:14-121:25 Int->V2 | {a : Num V0} -> Int->V2 | {a} -> {b : Num a} -> Int->a
374testdata/Internals.lc 108:14-122:22 V1 -> V2->Ordering | {a : Num V0} -> V1 -> V2->Ordering | {a} -> {b : Num a} -> a -> a->Ordering 374testdata/Internals.lc 108:14-122:22 V1 -> V2->Ordering | {a : Num V0} -> V1 -> V2->Ordering | {a} -> {b : Num a} -> a -> a->Ordering
375testdata/Internals.lc 108:14-123:22 V1->V2 | {a : Num V0} -> V1->V2 | {a} -> {b : Num a} -> a->a 375testdata/Internals.lc 108:14-123:22 V1->V2 | {a : Num V0} -> V1->V2 | {a} -> {b : Num a} -> a->a
376testdata/Internals.lc 109:13-109:20 Int->Int 376testdata/Internals.lc 109:19-109:20 V1
377testdata/Internals.lc 109:19-109:20 Int
378testdata/Internals.lc 110:13-110:27 Int -> Int->Ordering 377testdata/Internals.lc 110:13-110:27 Int -> Int->Ordering
379testdata/Internals.lc 111:13-111:26 Int->Int 378testdata/Internals.lc 111:13-111:26 Int->Int
380testdata/Internals.lc 112:14-112:18 Type 379testdata/Internals.lc 112:14-112:18 Type
@@ -420,65 +419,65 @@ testdata/Internals.lc 130:13-130:63 (V1 -> V2->Bool) -> V2 -> V3->Bool
420testdata/Internals.lc 130:13-138:16 Type | Type->Type 419testdata/Internals.lc 130:13-138:16 Type | Type->Type
421testdata/Internals.lc 130:13-141:29 V1 -> V2->Bool | {a : Eq V0} -> V1 -> V2->Bool | {a} -> {b : Eq a} -> a -> a->Bool 420testdata/Internals.lc 130:13-141:29 V1 -> V2->Bool | {a : Eq V0} -> V1 -> V2->Bool | {a} -> {b : Eq a} -> a -> a->Bool
422testdata/Internals.lc 130:35-130:39 Ordering->Bool 421testdata/Internals.lc 130:35-130:39 Ordering->Bool
423testdata/Internals.lc 130:35-130:63 Bool | String -> String->Bool | String->Bool 422testdata/Internals.lc 130:35-130:63 Bool
424testdata/Internals.lc 130:40-130:63 Ordering 423testdata/Internals.lc 130:40-130:63 Ordering
425testdata/Internals.lc 130:41-130:58 String -> String->Ordering 424testdata/Internals.lc 130:41-130:58 String -> String->Ordering
426testdata/Internals.lc 130:41-130:60 String->Ordering 425testdata/Internals.lc 130:41-130:60 String->Ordering
427testdata/Internals.lc 130:59-130:60 String 426testdata/Internals.lc 130:59-130:60 V3
428testdata/Internals.lc 130:61-130:62 String 427testdata/Internals.lc 130:61-130:62 V1
429testdata/Internals.lc 131:13-131:17 Type 428testdata/Internals.lc 131:13-131:17 Type
430testdata/Internals.lc 131:13-131:59 (V1 -> V2->Bool) -> V2 -> V3->Bool 429testdata/Internals.lc 131:13-131:59 (V1 -> V2->Bool) -> V2 -> V3->Bool
431testdata/Internals.lc 131:13-138:16 Type 430testdata/Internals.lc 131:13-138:16 Type
432testdata/Internals.lc 131:13-141:29 V1 -> V2->Bool 431testdata/Internals.lc 131:13-141:29 V1 -> V2->Bool
433testdata/Internals.lc 131:33-131:37 Ordering->Bool 432testdata/Internals.lc 131:33-131:37 Ordering->Bool
434testdata/Internals.lc 131:33-131:59 Bool | Char -> Char->Bool | Char->Bool 433testdata/Internals.lc 131:33-131:59 Bool
435testdata/Internals.lc 131:38-131:59 Ordering 434testdata/Internals.lc 131:38-131:59 Ordering
436testdata/Internals.lc 131:39-131:54 Char -> Char->Ordering 435testdata/Internals.lc 131:39-131:54 Char -> Char->Ordering
437testdata/Internals.lc 131:39-131:56 Char->Ordering 436testdata/Internals.lc 131:39-131:56 Char->Ordering
438testdata/Internals.lc 131:55-131:56 Char 437testdata/Internals.lc 131:55-131:56 V3
439testdata/Internals.lc 131:57-131:58 Char 438testdata/Internals.lc 131:57-131:58 V1
440testdata/Internals.lc 132:13-132:16 Type 439testdata/Internals.lc 132:13-132:16 Type
441testdata/Internals.lc 132:13-132:57 (V1 -> V2->Bool) -> V2 -> V3->Bool 440testdata/Internals.lc 132:13-132:57 (V1 -> V2->Bool) -> V2 -> V3->Bool
442testdata/Internals.lc 132:13-138:16 Type 441testdata/Internals.lc 132:13-138:16 Type
443testdata/Internals.lc 132:13-141:29 V1 -> V2->Bool 442testdata/Internals.lc 132:13-141:29 V1 -> V2->Bool
444testdata/Internals.lc 132:32-132:36 Ordering->Bool 443testdata/Internals.lc 132:32-132:36 Ordering->Bool
445testdata/Internals.lc 132:32-132:57 Bool | Int -> Int->Bool | Int->Bool 444testdata/Internals.lc 132:32-132:57 Bool
446testdata/Internals.lc 132:37-132:57 Ordering 445testdata/Internals.lc 132:37-132:57 Ordering
447testdata/Internals.lc 132:38-132:52 Int -> Int->Ordering 446testdata/Internals.lc 132:38-132:52 Int -> Int->Ordering
448testdata/Internals.lc 132:38-132:54 Int->Ordering 447testdata/Internals.lc 132:38-132:54 Int->Ordering
449testdata/Internals.lc 132:53-132:54 Int 448testdata/Internals.lc 132:53-132:54 V3
450testdata/Internals.lc 132:55-132:56 Int 449testdata/Internals.lc 132:55-132:56 V1
451testdata/Internals.lc 133:13-133:18 Type 450testdata/Internals.lc 133:13-133:18 Type
452testdata/Internals.lc 133:13-133:61 (V1 -> V2->Bool) -> V2 -> V3->Bool 451testdata/Internals.lc 133:13-133:61 (V1 -> V2->Bool) -> V2 -> V3->Bool
453testdata/Internals.lc 133:13-138:16 Type 452testdata/Internals.lc 133:13-138:16 Type
454testdata/Internals.lc 133:13-141:29 V1 -> V2->Bool 453testdata/Internals.lc 133:13-141:29 V1 -> V2->Bool
455testdata/Internals.lc 133:34-133:38 Ordering->Bool 454testdata/Internals.lc 133:34-133:38 Ordering->Bool
456testdata/Internals.lc 133:34-133:61 Bool | Float -> Float->Bool | Float->Bool 455testdata/Internals.lc 133:34-133:61 Bool
457testdata/Internals.lc 133:39-133:61 Ordering 456testdata/Internals.lc 133:39-133:61 Ordering
458testdata/Internals.lc 133:40-133:56 Float -> Float->Ordering 457testdata/Internals.lc 133:40-133:56 Float -> Float->Ordering
459testdata/Internals.lc 133:40-133:58 Float->Ordering 458testdata/Internals.lc 133:40-133:58 Float->Ordering
460testdata/Internals.lc 133:57-133:58 Float 459testdata/Internals.lc 133:57-133:58 V3
461testdata/Internals.lc 133:59-133:60 Float 460testdata/Internals.lc 133:59-133:60 V1
462testdata/Internals.lc 134:13-134:17 Type 461testdata/Internals.lc 134:13-134:17 Type
463testdata/Internals.lc 134:13-137:19 (V1 -> V2->Bool) -> V2 -> V3->Bool 462testdata/Internals.lc 134:13-137:19 (V1 -> V2->Bool) -> V2 -> V3->Bool
464testdata/Internals.lc 134:13-138:16 Type 463testdata/Internals.lc 134:13-138:16 Type
465testdata/Internals.lc 134:13-141:29 V1 -> V2->Bool 464testdata/Internals.lc 134:13-141:29 V1 -> V2->Bool
466testdata/Internals.lc 135:5-135:9 Bool 465testdata/Internals.lc 135:5-135:9 V2
467testdata/Internals.lc 135:5-137:19 Bool | Bool -> Bool->Bool | Bool->Bool 466testdata/Internals.lc 135:5-137:19 Bool
468testdata/Internals.lc 135:13-135:17 Bool 467testdata/Internals.lc 135:13-135:17 Bool
469testdata/Internals.lc 135:13-137:19 Bool 468testdata/Internals.lc 135:13-137:19 Bool
470testdata/Internals.lc 135:20-135:24 Bool 469testdata/Internals.lc 135:20-135:24 Bool
471testdata/Internals.lc 135:20-137:19 Bool->Bool 470testdata/Internals.lc 135:20-137:19 Bool->Bool
472testdata/Internals.lc 136:14-136:19 Bool 471testdata/Internals.lc 136:14-136:19 V1
473testdata/Internals.lc 136:14-137:19 Bool 472testdata/Internals.lc 136:14-137:19 Bool
474testdata/Internals.lc 136:22-136:26 Bool 473testdata/Internals.lc 136:22-136:26 Bool
475testdata/Internals.lc 136:22-137:19 Bool->Bool 474testdata/Internals.lc 136:22-137:19 Bool->Bool
476testdata/Internals.lc 137:14-137:19 Bool 475testdata/Internals.lc 137:14-137:19 Bool
477testdata/Internals.lc 138:13-138:16 Type 476testdata/Internals.lc 138:13-138:16 Type
478testdata/Internals.lc 138:13-141:29 (V1 -> V2->Bool) -> V2 -> V3->Bool 477testdata/Internals.lc 138:13-141:29 (V1 -> V2->Bool) -> V2 -> V3->Bool
479testdata/Internals.lc 139:5-139:9 Nat 478testdata/Internals.lc 139:5-139:9 V2
480testdata/Internals.lc 139:5-141:29 Bool | Nat -> Nat->Bool | Nat->Bool 479testdata/Internals.lc 139:5-141:29 Bool
481testdata/Internals.lc 139:15-139:19 Nat 480testdata/Internals.lc 139:15-139:19 V1
482testdata/Internals.lc 139:15-141:29 Bool 481testdata/Internals.lc 139:15-141:29 Bool
483testdata/Internals.lc 139:24-139:28 Bool 482testdata/Internals.lc 139:24-139:28 Bool
484testdata/Internals.lc 139:24-141:29 Nat->Bool 483testdata/Internals.lc 139:24-141:29 Nat->Bool
diff --git a/testdata/typeclass.out b/testdata/typeclass.out
index 5f036c40..84ba69fe 100644
--- a/testdata/typeclass.out
+++ b/testdata/typeclass.out
@@ -43,10 +43,10 @@ testdata/typeclass.lc 20:17-20:19 {a} -> {b : Eq a} -> a -> a->Bool
43testdata/typeclass.lc 20:20-20:21 V2 43testdata/typeclass.lc 20:20-20:21 V2
44testdata/typeclass.lc 22:13-22:17 Type | Type->Type 44testdata/typeclass.lc 22:13-22:17 Type | Type->Type
45testdata/typeclass.lc 22:13-24:23 (V1 -> V2->Bool) -> V2 -> V3->Bool | {a : Eq V0} -> V1 -> V2->Bool | {a} -> {b : Eq a} -> a -> a->Bool 45testdata/typeclass.lc 22:13-24:23 (V1 -> V2->Bool) -> V2 -> V3->Bool | {a : Eq V0} -> V1 -> V2->Bool | {a} -> {b : Eq a} -> a -> a->Bool
46testdata/typeclass.lc 23:5-23:9 Bool 46testdata/typeclass.lc 23:5-23:9 V2
47testdata/typeclass.lc 23:5-24:23 Bool | Bool -> Bool->Bool | Bool->Bool 47testdata/typeclass.lc 23:5-24:23 Bool
48testdata/typeclass.lc 23:17-23:18 Bool 48testdata/typeclass.lc 23:17-23:18 Bool
49testdata/typeclass.lc 23:17-24:23 Bool->Bool 49testdata/typeclass.lc 23:17-24:23 Bool->Bool
50testdata/typeclass.lc 24:18-24:21 Bool->Bool 50testdata/typeclass.lc 24:18-24:21 Bool->Bool
51testdata/typeclass.lc 24:18-24:23 Bool 51testdata/typeclass.lc 24:18-24:23 Bool
52testdata/typeclass.lc 24:22-24:23 Bool 52testdata/typeclass.lc 24:22-24:23 V1