diff options
author | Péter Diviánszky <divipp@gmail.com> | 2016-05-04 11:01:16 +0200 |
---|---|---|
committer | Péter Diviánszky <divipp@gmail.com> | 2016-05-04 11:01:16 +0200 |
commit | 51b37f58afba2c9aaf80bb49267aa7b74f757d52 (patch) | |
tree | f6f3cf5c3f079dc8559fefd470effba7b3e0933a | |
parent | 4fd500adc5a8eee72caca044bac5fd11ef10c6b5 (diff) |
improve pretty print
18 files changed, 112 insertions, 113 deletions
diff --git a/src/LambdaCube/Compiler/Core.hs b/src/LambdaCube/Compiler/Core.hs index 818ffedd..7c60cf61 100644 --- a/src/LambdaCube/Compiler/Core.hs +++ b/src/LambdaCube/Compiler/Core.hs | |||
@@ -6,14 +6,10 @@ | |||
6 | {-# LANGUAGE FlexibleInstances #-} | 6 | {-# LANGUAGE FlexibleInstances #-} |
7 | {-# LANGUAGE NoMonomorphismRestriction #-} | 7 | {-# LANGUAGE NoMonomorphismRestriction #-} |
8 | {-# LANGUAGE ScopedTypeVariables #-} | 8 | {-# LANGUAGE ScopedTypeVariables #-} |
9 | {-# LANGUAGE RecursiveDo #-} | ||
10 | {-# LANGUAGE RankNTypes #-} | 9 | {-# LANGUAGE RankNTypes #-} |
11 | {-# LANGUAGE MultiParamTypeClasses #-} | 10 | {-# LANGUAGE MultiParamTypeClasses #-} |
12 | {-# LANGUAGE UndecidableInstances #-} | 11 | --{-# OPTIONS_GHC -fno-warn-overlapping-patterns #-} -- TODO: remove |
13 | {-# LANGUAGE GeneralizedNewtypeDeriving #-} | 12 | --{-# OPTIONS_GHC -fno-warn-unused-binds #-} -- TODO: remove |
14 | {-# LANGUAGE DeriveFunctor #-} | ||
15 | {-# OPTIONS_GHC -fno-warn-overlapping-patterns #-} -- TODO: remove | ||
16 | {-# OPTIONS_GHC -fno-warn-unused-binds #-} -- TODO: remove | ||
17 | module LambdaCube.Compiler.Core where | 13 | module LambdaCube.Compiler.Core where |
18 | 14 | ||
19 | import Data.Monoid | 15 | import Data.Monoid |
@@ -228,7 +224,7 @@ data ExpType = ET {expr :: Exp, ty :: Type} | |||
228 | instance Rearrange ExpType where | 224 | instance Rearrange ExpType where |
229 | rearrange l f (ET e t) = ET (rearrange l f e) (rearrange l f t) | 225 | rearrange l f (ET e t) = ET (rearrange l f e) (rearrange l f t) |
230 | 226 | ||
231 | instance PShow ExpType where pShow (ET x t) = DAnn (pShow x) (pShow t) | 227 | instance PShow ExpType where pShow = mkDoc False |
232 | 228 | ||
233 | type SExp2 = SExp' ExpType | 229 | type SExp2 = SExp' ExpType |
234 | 230 | ||
@@ -246,22 +242,22 @@ isRHS _ = False | |||
246 | pattern Reverse xs <- (reverse -> xs) | 242 | pattern Reverse xs <- (reverse -> xs) |
247 | where Reverse = reverse | 243 | where Reverse = reverse |
248 | 244 | ||
249 | pattern Fun' f vs xs n <- Fun_ _ f vs xs n | 245 | pattern Fun' f vs xs n <- Fun_ _ f vs xs n |
250 | where Fun' f vs xs n = Fun_ (foldMap maxDB_ vs <> foldMap maxDB_ xs {- <> maxDB_ n-}) f vs xs n | 246 | where Fun' f vs xs n = Fun_ (foldMap maxDB_ vs <> foldMap maxDB_ xs {- <> maxDB_ n-}) f vs xs n |
251 | pattern CaseFun_ a b c <- CaseFun__ _ a b c | 247 | pattern CaseFun_ a b c <- CaseFun__ _ a b c |
252 | where CaseFun_ a b c = CaseFun__ (maxDB_ c <> foldMap maxDB_ b) a b c | 248 | where CaseFun_ a b c = CaseFun__ (maxDB_ c <> foldMap maxDB_ b) a b c |
253 | pattern TyCaseFun_ a b c <- TyCaseFun__ _ a b c | 249 | pattern TyCaseFun_ a b c <- TyCaseFun__ _ a b c |
254 | where TyCaseFun_ a b c = TyCaseFun__ (foldMap maxDB_ b <> maxDB_ c) a b c | 250 | where TyCaseFun_ a b c = TyCaseFun__ (foldMap maxDB_ b <> maxDB_ c) a b c |
255 | pattern App_ a b <- App__ _ a b | 251 | pattern App_ a b <- App__ _ a b |
256 | where App_ a b = App__ (maxDB_ a <> maxDB_ b) a b | 252 | where App_ a b = App__ (maxDB_ a <> maxDB_ b) a b |
257 | pattern Con x n y <- Con_ _ x n y | 253 | pattern Con x n y <- Con_ _ x n y |
258 | where Con x n y = Con_ (foldMap maxDB_ y) x n y | 254 | where Con x n y = Con_ (foldMap maxDB_ y) x n y |
259 | pattern TyCon x y <- TyCon_ _ x y | 255 | pattern TyCon x y <- TyCon_ _ x y |
260 | where TyCon x y = TyCon_ (foldMap maxDB_ y) x y | 256 | where TyCon x y = TyCon_ (foldMap maxDB_ y) x y |
261 | pattern Lam y <- Lam_ _ y | 257 | pattern Lam y <- Lam_ _ y |
262 | where Lam y = Lam_ (lowerDB (maxDB_ y)) y | 258 | where Lam y = Lam_ (lowerDB (maxDB_ y)) y |
263 | pattern Pi v x y <- Pi_ _ v x y | 259 | pattern Pi v x y <- Pi_ _ v x y |
264 | where Pi v x y = Pi_ (maxDB_ x <> lowerDB (maxDB_ y)) v x y | 260 | where Pi v x y = Pi_ (maxDB_ x <> lowerDB (maxDB_ y)) v x y |
265 | 261 | ||
266 | pattern CaseFun a b c = Neut (CaseFun_ a b c) | 262 | pattern CaseFun a b c = Neut (CaseFun_ a b c) |
267 | pattern TyCaseFun a b c = Neut (TyCaseFun_ a b c) | 263 | pattern TyCaseFun a b c = Neut (TyCaseFun_ a b c) |
@@ -584,13 +580,14 @@ class MkDoc a where | |||
584 | mkDoc :: Bool {-print reduced-} -> a -> Doc | 580 | mkDoc :: Bool {-print reduced-} -> a -> Doc |
585 | 581 | ||
586 | instance MkDoc ExpType where | 582 | instance MkDoc ExpType where |
587 | mkDoc pr (ET e _) = mkDoc pr e | 583 | mkDoc pr (ET e TType) = mkDoc pr e |
584 | mkDoc pr (ET e t) = DAnn (mkDoc pr e) (mkDoc pr t) | ||
588 | 585 | ||
589 | instance MkDoc Exp where | 586 | instance MkDoc Exp where |
590 | mkDoc pr e = green $ f e | 587 | mkDoc pr e = f e |
591 | where | 588 | where |
592 | f = \case | 589 | f = \case |
593 | Lam b -> shLam_ True (BLam Visible) Nothing{-todo!-} (f b) | 590 | Lam b -> shLam_ (usedVar 0 b) (BLam Visible) Nothing (f b) |
594 | Pi h TType b -> shLam_ (usedVar 0 b) (BPi h) Nothing (f b) | 591 | Pi h TType b -> shLam_ (usedVar 0 b) (BPi h) Nothing (f b) |
595 | Pi h a b -> shLam (usedVar 0 b) (BPi h) (f a) (f b) | 592 | Pi h a b -> shLam (usedVar 0 b) (BPi h) (f a) (f b) |
596 | ENat' n -> pShow n | 593 | ENat' n -> pShow n |
@@ -605,17 +602,17 @@ instance MkDoc Exp where | |||
605 | RHS x -> text "_rhs" `DApp` f x | 602 | RHS x -> text "_rhs" `DApp` f x |
606 | 603 | ||
607 | instance MkDoc Neutral where | 604 | instance MkDoc Neutral where |
608 | mkDoc pr e = green $ f e | 605 | mkDoc pr e = f e |
609 | where | 606 | where |
610 | g = mkDoc pr | 607 | g = mkDoc pr |
611 | f = \case | 608 | f = \case |
612 | CstrT' t a b -> shCstr (g (ET a t)) (g (ET b t)) | 609 | CstrT' t a b -> shCstr (g a) (g (ET b t)) |
613 | Reduced' a | pr -> g a | 610 | Reduced' a | pr -> g a |
614 | Fun' s vs (mkExpTypes (nType s) . reverse -> xs) _ -> foldl (shApp Visible) (pShow s) (g <$> xs) | 611 | Fun' s vs xs _ -> foldl DApp (pShow s) (g <$> reverse xs) |
615 | Var_ k -> shVar k | 612 | Var_ k -> shVar k |
616 | App_ a b -> shApp Visible (g a) (g b) | 613 | App_ a b -> f a `DApp` g b |
617 | CaseFun_ s xs n -> foldl (shApp Visible) (pShow s) (map g $ {-mkExpTypes (nType s) $ makeCaseFunPars te n ++ -} xs ++ [Neut n]) | 614 | CaseFun_ s xs n -> foldl DApp (pShow s) (map g $ xs ++ [Neut n]) |
618 | TyCaseFun_ s [m, t, f] n -> foldl (shApp Visible) (pShow s) (g <$> mkExpTypes (nType s) [m, t, Neut n, f]) | 615 | TyCaseFun_ s [m, t, f] n -> foldl DApp (pShow s) (g <$> [m, t, Neut n, f]) |
619 | TyCaseFun_ s _ n -> error $ "mkDoc TyCaseFun" | 616 | TyCaseFun_ s _ n -> error $ "mkDoc TyCaseFun" |
620 | 617 | ||
621 | getTup (hnf -> ConN FHCons [_, _, x, xs]) = (x:) <$> getTup xs | 618 | getTup (hnf -> ConN FHCons [_, _, x, xs]) = (x:) <$> getTup xs |
@@ -804,9 +801,6 @@ app_ (Neut f) a = neutApp f a | |||
804 | 801 | ||
805 | conType (snd . getParams . hnf -> TyCon (TyConName _ _ _ cs _) _) (ConName _ n t) = t --snd $ cs !! n | 802 | conType (snd . getParams . hnf -> TyCon (TyConName _ _ _ cs _) _) (ConName _ n t) = t --snd $ cs !! n |
806 | 803 | ||
807 | mkExpTypes t [] = [] | ||
808 | mkExpTypes t@(Pi _ a _) (x: xs) = ET x t: mkExpTypes (appTy t x) xs | ||
809 | |||
810 | appTy (Pi _ a b) x = subst 0 x b | 804 | appTy (Pi _ a b) x = subst 0 x b |
811 | appTy t x = error $ "appTy: " ++ ppShow t | 805 | appTy t x = error $ "appTy: " ++ ppShow t |
812 | 806 | ||
@@ -818,9 +812,9 @@ getParams x = ([], x) | |||
818 | 812 | ||
819 | class NType a where nType :: a -> Type | 813 | class NType a where nType :: a -> Type |
820 | 814 | ||
821 | instance NType FunName where nType (FunName _ _ t) = t | 815 | instance NType FunName where nType (FunName _ _ t) = t |
822 | instance NType TyConName where nType (TyConName _ _ t _ _) = t | 816 | instance NType TyConName where nType (TyConName _ _ t _ _) = t |
823 | instance NType CaseFunName where nType (CaseFunName _ t _) = t | 817 | instance NType CaseFunName where nType (CaseFunName _ t _) = t |
824 | instance NType TyCaseFunName where nType (TyCaseFunName _ t) = t | 818 | instance NType TyCaseFunName where nType (TyCaseFunName _ t) = t |
825 | 819 | ||
826 | instance NType Lit where | 820 | instance NType Lit where |
diff --git a/testdata/Builtins.out b/testdata/Builtins.out index 314c01c4..8730e52a 100644 --- a/testdata/Builtins.out +++ b/testdata/Builtins.out | |||
@@ -1494,7 +1494,8 @@ mapPrimitives | |||
1494 | 'ListElem :: Type -> Type | 1494 | 'ListElem :: Type -> Type |
1495 | fetchArrays | 1495 | fetchArrays |
1496 | :: forall (a :: PrimitiveType) (b :: [Type]) (c :: [Type]) | 1496 | :: forall (a :: PrimitiveType) (b :: [Type]) (c :: [Type]) |
1497 | . (b ~ map Type Type ListElem c) => HList c -> PrimitiveStream a (HList b) | 1497 | . (b ~ (map Type Type ListElem c :: [Type])) |
1498 | => HList c -> PrimitiveStream a (HList b) | ||
1498 | fetch | 1499 | fetch |
1499 | :: forall (a :: PrimitiveType) (b :: [Type]) | 1500 | :: forall (a :: PrimitiveType) (b :: [Type]) |
1500 | . String -> HList b -> PrimitiveStream a (HList b) | 1501 | . String -> HList b -> PrimitiveStream a (HList b) |
@@ -1503,7 +1504,7 @@ fetchStream | |||
1503 | :: forall (a :: PrimitiveType) (b :: [Type]) | 1504 | :: forall (a :: PrimitiveType) (b :: [Type]) |
1504 | . String | 1505 | . String |
1505 | -> forall (c :: [String]) | 1506 | -> forall (c :: [String]) |
1506 | -> (len String c ~ len Type b) => PrimitiveStream a (HList b) | 1507 | -> (len String c ~ (len Type b :: Int)) => PrimitiveStream a (HList b) |
1507 | 'SimpleFragment :: Type -> Type | 1508 | 'SimpleFragment :: Type -> Type |
1508 | SimpleFragment :: forall a . Vec 3 Float -> a -> SimpleFragment a | 1509 | SimpleFragment :: forall a . Vec 3 Float -> a -> SimpleFragment a |
1509 | case'SimpleFragment | 1510 | case'SimpleFragment |
@@ -1855,7 +1856,8 @@ match'Interpolated | |||
1855 | -> (forall b -> a (Interpolated b)) -> forall c -> a c -> a c | 1856 | -> (forall b -> a (Interpolated b)) -> forall c -> a c -> a c |
1856 | rasterizePrimitive | 1857 | rasterizePrimitive |
1857 | :: forall (a :: [Type]) (b :: [Type]) (c :: [Type]) (d :: PrimitiveType) | 1858 | :: forall (a :: [Type]) (b :: [Type]) (c :: [Type]) (d :: PrimitiveType) |
1858 | . (map Type Type Interpolated a ~ b, c ~ Vec 4 Float : a) | 1859 | . (map Type Type Interpolated a ~ (b :: [Type]), c |
1860 | ~ (Vec 4 Float : a :: [Type])) | ||
1859 | => HList b | 1861 | => HList b |
1860 | -> RasterContext (HList c) d | 1862 | -> RasterContext (HList c) d |
1861 | -> Primitive (HList c) d -> FragmentStream 1 (HList a) | 1863 | -> Primitive (HList c) d -> FragmentStream 1 (HList a) |
@@ -1880,7 +1882,7 @@ imageType' :: [ImageKind] -> [Type] | |||
1880 | 'FragmentOperationKind :: Type -> ImageKind | 1882 | 'FragmentOperationKind :: Type -> ImageKind |
1881 | Accumulate | 1883 | Accumulate |
1882 | :: forall (a :: [ImageKind]) (b :: Nat) (c :: [Type]) | 1884 | :: forall (a :: [ImageKind]) (b :: Nat) (c :: [Type]) |
1883 | . (a ~ map Type ImageKind FragmentOperationKind c) | 1885 | . (a ~ (map Type ImageKind FragmentOperationKind c :: [ImageKind])) |
1884 | => HList c | 1886 | => HList c |
1885 | -> FragmentStream b (HList (imageType' a)) -> FrameBuffer b a -> FrameBuffer b a | 1887 | -> FragmentStream b (HList (imageType' a)) -> FrameBuffer b a -> FrameBuffer b a |
1886 | accumulateWith :: forall a b . a -> b -> (a, b) | 1888 | accumulateWith :: forall a b . a -> b -> (a, b) |
@@ -5297,7 +5299,8 @@ testdata/Builtins.lc 255:45-255:46 | |||
5297 | Type | 5299 | Type |
5298 | testdata/Builtins.lc 260:1-260:12 | 5300 | testdata/Builtins.lc 260:1-260:12 |
5299 | forall (a :: PrimitiveType) (b :: [Type]) (c :: [Type]) | 5301 | forall (a :: PrimitiveType) (b :: [Type]) (c :: [Type]) |
5300 | . (b ~ map Type Type ListElem c) => HList c -> PrimitiveStream a (HList b) | 5302 | . (b ~ (map Type Type ListElem c :: [Type])) |
5303 | => HList c -> PrimitiveStream a (HList b) | ||
5301 | testdata/Builtins.lc 260:32-260:119 | 5304 | testdata/Builtins.lc 260:32-260:119 |
5302 | Type | Type | Type | 5305 | Type | Type | Type |
5303 | testdata/Builtins.lc 260:56-260:57 | 5306 | testdata/Builtins.lc 260:56-260:57 |
@@ -5381,7 +5384,7 @@ testdata/Builtins.lc 266:1-266:12 | |||
5381 | forall (a :: PrimitiveType) (b :: [Type]) | 5384 | forall (a :: PrimitiveType) (b :: [Type]) |
5382 | . String | 5385 | . String |
5383 | -> forall (c :: [String]) | 5386 | -> forall (c :: [String]) |
5384 | -> (len String c ~ len Type b) => PrimitiveStream a (HList b) | 5387 | -> (len String c ~ (len Type b :: Int)) => PrimitiveStream a (HList b) |
5385 | testdata/Builtins.lc 266:31-266:37 | 5388 | testdata/Builtins.lc 266:31-266:37 |
5386 | Type | 5389 | Type |
5387 | testdata/Builtins.lc 266:31-266:123 | 5390 | testdata/Builtins.lc 266:31-266:123 |
@@ -6595,7 +6598,8 @@ testdata/Builtins.lc 478:55-478:56 | |||
6595 | Type | 6598 | Type |
6596 | testdata/Builtins.lc 480:1-480:19 | 6599 | testdata/Builtins.lc 480:1-480:19 |
6597 | forall (a :: [Type]) (b :: [Type]) (c :: [Type]) (d :: PrimitiveType) | 6600 | forall (a :: [Type]) (b :: [Type]) (c :: [Type]) (d :: PrimitiveType) |
6598 | . (map Type Type Interpolated a ~ b, c ~ Vec 4 Float : a) | 6601 | . (map Type Type Interpolated a ~ (b :: [Type]), c |
6602 | ~ (Vec 4 Float : a :: [Type])) | ||
6599 | => HList b | 6603 | => HList b |
6600 | -> RasterContext (HList c) d | 6604 | -> RasterContext (HList c) d |
6601 | -> Primitive (HList c) d -> FragmentStream 1 (HList a) | 6605 | -> Primitive (HList c) d -> FragmentStream 1 (HList a) |
@@ -6719,7 +6723,8 @@ testdata/Builtins.lc 488:40-488:73 | |||
6719 | [[Fragment 1 (HList _b)]] | 6723 | [[Fragment 1 (HList _b)]] |
6720 | testdata/Builtins.lc 488:45-488:63 | 6724 | testdata/Builtins.lc 488:45-488:63 |
6721 | forall (a :: [Type]) (b :: [Type]) (c :: [Type]) (d :: PrimitiveType) | 6725 | forall (a :: [Type]) (b :: [Type]) (c :: [Type]) (d :: PrimitiveType) |
6722 | . (map Type Type Interpolated a ~ b, c ~ Vec 4 Float : a) | 6726 | . (map Type Type Interpolated a ~ (b :: [Type]), c |
6727 | ~ (Vec 4 Float : a :: [Type])) | ||
6723 | => HList b | 6728 | => HList b |
6724 | -> RasterContext (HList c) d | 6729 | -> RasterContext (HList c) d |
6725 | -> Primitive (HList c) d -> FragmentStream 1 (HList a) | 6730 | -> Primitive (HList c) d -> FragmentStream 1 (HList a) |
@@ -6858,7 +6863,7 @@ testdata/Builtins.lc 515:102-515:103 | |||
6858 | ImageKind | 6863 | ImageKind |
6859 | testdata/Builtins.lc 517:1-517:11 | 6864 | testdata/Builtins.lc 517:1-517:11 |
6860 | forall (a :: [ImageKind]) (b :: Nat) (c :: [Type]) | 6865 | forall (a :: [ImageKind]) (b :: Nat) (c :: [Type]) |
6861 | . (a ~ map Type ImageKind FragmentOperationKind c) | 6866 | . (a ~ (map Type ImageKind FragmentOperationKind c :: [ImageKind])) |
6862 | => HList c | 6867 | => HList c |
6863 | -> FragmentStream b (HList (imageType' a)) -> FrameBuffer b a -> FrameBuffer b a | 6868 | -> FragmentStream b (HList (imageType' a)) -> FrameBuffer b a -> FrameBuffer b a |
6864 | testdata/Builtins.lc 517:15-517:174 | 6869 | testdata/Builtins.lc 517:15-517:174 |
@@ -6958,7 +6963,7 @@ testdata/Builtins.lc 520:1-520:8 | |||
6958 | -> FrameBuffer a (map Type ImageKind FragmentOperationKind b) | 6963 | -> FrameBuffer a (map Type ImageKind FragmentOperationKind b) |
6959 | testdata/Builtins.lc 520:25-520:35 | 6964 | testdata/Builtins.lc 520:25-520:35 |
6960 | forall (a :: [ImageKind]) (b :: Nat) (c :: [Type]) | 6965 | forall (a :: [ImageKind]) (b :: Nat) (c :: [Type]) |
6961 | . (a ~ map Type ImageKind FragmentOperationKind c) | 6966 | . (a ~ (map Type ImageKind FragmentOperationKind c :: [ImageKind])) |
6962 | => HList c | 6967 | => HList c |
6963 | -> FragmentStream b (HList (imageType' a)) -> FrameBuffer b a -> FrameBuffer b a | 6968 | -> FragmentStream b (HList (imageType' a)) -> FrameBuffer b a -> FrameBuffer b a |
6964 | testdata/Builtins.lc 520:25-520:39 | 6969 | testdata/Builtins.lc 520:25-520:39 |
@@ -7058,7 +7063,7 @@ testdata/Builtins.lc 534:1-534:11 | |||
7058 | -> FrameBuffer a (map Type ImageKind FragmentOperationKind b) | 7063 | -> FrameBuffer a (map Type ImageKind FragmentOperationKind b) |
7059 | testdata/Builtins.lc 534:34-534:44 | 7064 | testdata/Builtins.lc 534:34-534:44 |
7060 | forall (a :: [ImageKind]) (b :: Nat) (c :: [Type]) | 7065 | forall (a :: [ImageKind]) (b :: Nat) (c :: [Type]) |
7061 | . (a ~ map Type ImageKind FragmentOperationKind c) | 7066 | . (a ~ (map Type ImageKind FragmentOperationKind c :: [ImageKind])) |
7062 | => HList c | 7067 | => HList c |
7063 | -> FragmentStream b (HList (imageType' a)) -> FrameBuffer b a -> FrameBuffer b a | 7068 | -> FragmentStream b (HList (imageType' a)) -> FrameBuffer b a -> FrameBuffer b a |
7064 | testdata/Builtins.lc 534:34-534:48 | 7069 | testdata/Builtins.lc 534:34-534:48 |
diff --git a/testdata/framebuffer02.reject.out b/testdata/framebuffer02.reject.out index 3280dc3c..92a5c846 100644 --- a/testdata/framebuffer02.reject.out +++ b/testdata/framebuffer02.reject.out | |||
@@ -1,7 +1,7 @@ | |||
1 | type error: can not unify | 1 | type error: can not unify |
2 | [32m0[0m | 2 | 0 |
3 | with | 3 | with |
4 | [32m1[0m | 4 | 1 |
5 | 5 | ||
6 | in testdata/framebuffer02.reject.lc:2:17: | 6 | in testdata/framebuffer02.reject.lc:2:17: |
7 | let frame = FrameBuffer (colorImage1 (V4 0.0 0.0 0.4 1.0) | 7 | let frame = FrameBuffer (colorImage1 (V4 0.0 0.0 0.4 1.0) |
@@ -10,9 +10,9 @@ in testdata/framebuffer02.reject.lc:2:17: | |||
10 | ) | 10 | ) |
11 | ------------ trace | 11 | ------------ trace |
12 | !type error: can not unify | 12 | !type error: can not unify |
13 | [32m0[0m | 13 | 0 |
14 | with | 14 | with |
15 | [32m1[0m | 15 | 1 |
16 | 16 | ||
17 | in testdata/framebuffer02.reject.lc:2:17: | 17 | in testdata/framebuffer02.reject.lc:2:17: |
18 | let frame = FrameBuffer (colorImage1 (V4 0.0 0.0 0.4 1.0) | 18 | let frame = FrameBuffer (colorImage1 (V4 0.0 0.0 0.4 1.0) |
diff --git a/testdata/language-features/adt/adt02.reject.out b/testdata/language-features/adt/adt02.reject.out index 155444a2..9be810e4 100644 --- a/testdata/language-features/adt/adt02.reject.out +++ b/testdata/language-features/adt/adt02.reject.out | |||
@@ -1,7 +1,7 @@ | |||
1 | type error: can not unify | 1 | type error: can not unify |
2 | [32m'Bool[0m | 2 | 'Bool |
3 | with | 3 | with |
4 | [32m'Int[0m | 4 | 'Int |
5 | 5 | ||
6 | in proj | 6 | in proj |
7 | ------------ trace | 7 | ------------ trace |
@@ -15,9 +15,9 @@ case'Data3 | |||
15 | -> forall (h :: Data3) -> a h | 15 | -> forall (h :: Data3) -> a h |
16 | match'Data3 :: forall (a :: Type -> Type) -> a Data3 -> forall b -> a b -> a b | 16 | match'Data3 :: forall (a :: Type -> Type) -> a Data3 -> forall b -> a b -> a b |
17 | !type error: can not unify | 17 | !type error: can not unify |
18 | [32m'Bool[0m | 18 | 'Bool |
19 | with | 19 | with |
20 | [32m'Int[0m | 20 | 'Int |
21 | 21 | ||
22 | in proj | 22 | in proj |
23 | ------------ tooltips | 23 | ------------ tooltips |
diff --git a/testdata/language-features/basic-list/list07.reject.out b/testdata/language-features/basic-list/list07.reject.out index a40c8c73..106e8c65 100644 --- a/testdata/language-features/basic-list/list07.reject.out +++ b/testdata/language-features/basic-list/list07.reject.out | |||
@@ -1,14 +1,14 @@ | |||
1 | type error: can not unify | 1 | type error: can not unify |
2 | [32m'Float[0m | 2 | 'Float |
3 | with | 3 | with |
4 | [32m'Char[0m | 4 | 'Char |
5 | 5 | ||
6 | in builtin Nil | 6 | in builtin Nil |
7 | ------------ trace | 7 | ------------ trace |
8 | !type error: can not unify | 8 | !type error: can not unify |
9 | [32m'Float[0m | 9 | 'Float |
10 | with | 10 | with |
11 | [32m'Char[0m | 11 | 'Char |
12 | 12 | ||
13 | in builtin Nil | 13 | in builtin Nil |
14 | ------------ tooltips | 14 | ------------ tooltips |
diff --git a/testdata/language-features/basic-list/list10.reject.out b/testdata/language-features/basic-list/list10.reject.out index 0ce8bd30..f84914ac 100644 --- a/testdata/language-features/basic-list/list10.reject.out +++ b/testdata/language-features/basic-list/list10.reject.out | |||
@@ -1,14 +1,14 @@ | |||
1 | type error: can not unify | 1 | type error: can not unify |
2 | [32m'Int[0m | 2 | 'Int |
3 | with | 3 | with |
4 | [32m'Float[0m | 4 | 'Float |
5 | 5 | ||
6 | in builtin Nil | 6 | in builtin Nil |
7 | ------------ trace | 7 | ------------ trace |
8 | !type error: can not unify | 8 | !type error: can not unify |
9 | [32m'Int[0m | 9 | 'Int |
10 | with | 10 | with |
11 | [32m'Float[0m | 11 | 'Float |
12 | 12 | ||
13 | in builtin Nil | 13 | in builtin Nil |
14 | ------------ tooltips | 14 | ------------ tooltips |
diff --git a/testdata/language-features/basic-list/list14.reject.out b/testdata/language-features/basic-list/list14.reject.out index a8d86a22..65cfb9e0 100644 --- a/testdata/language-features/basic-list/list14.reject.out +++ b/testdata/language-features/basic-list/list14.reject.out | |||
@@ -1,16 +1,16 @@ | |||
1 | type error: can not unify | 1 | type error: can not unify |
2 | [32m['Char][0m | 2 | ['Char] |
3 | with | 3 | with |
4 | [32m()[0m | 4 | () |
5 | 5 | ||
6 | in testdata/language-features/basic-list/list14.reject.lc:1:17: | 6 | in testdata/language-features/basic-list/list14.reject.lc:1:17: |
7 | value = 'h':'i':() | 7 | value = 'h':'i':() |
8 | ^^ | 8 | ^^ |
9 | ------------ trace | 9 | ------------ trace |
10 | !type error: can not unify | 10 | !type error: can not unify |
11 | [32m['Char][0m | 11 | ['Char] |
12 | with | 12 | with |
13 | [32m()[0m | 13 | () |
14 | 14 | ||
15 | in testdata/language-features/basic-list/list14.reject.lc:1:17: | 15 | in testdata/language-features/basic-list/list14.reject.lc:1:17: |
16 | value = 'h':'i':() | 16 | value = 'h':'i':() |
diff --git a/testdata/language-features/basic-list/list15.reject.out b/testdata/language-features/basic-list/list15.reject.out index 4260adbe..c64dccf4 100644 --- a/testdata/language-features/basic-list/list15.reject.out +++ b/testdata/language-features/basic-list/list15.reject.out | |||
@@ -1,16 +1,16 @@ | |||
1 | type error: can not unify | 1 | type error: can not unify |
2 | [32m'Char[0m | 2 | 'Char |
3 | with | 3 | with |
4 | [32m()[0m | 4 | () |
5 | 5 | ||
6 | in testdata/language-features/basic-list/list15.reject.lc:1:20: | 6 | in testdata/language-features/basic-list/list15.reject.lc:1:20: |
7 | value = 'h':'i':():[] | 7 | value = 'h':'i':():[] |
8 | ^^ | 8 | ^^ |
9 | ------------ trace | 9 | ------------ trace |
10 | !type error: can not unify | 10 | !type error: can not unify |
11 | [32m'Char[0m | 11 | 'Char |
12 | with | 12 | with |
13 | [32m()[0m | 13 | () |
14 | 14 | ||
15 | in testdata/language-features/basic-list/list15.reject.lc:1:20: | 15 | in testdata/language-features/basic-list/list15.reject.lc:1:20: |
16 | value = 'h':'i':():[] | 16 | value = 'h':'i':():[] |
diff --git a/testdata/language-features/basic-list/list16.reject.out b/testdata/language-features/basic-list/list16.reject.out index 912f567c..be6468cb 100644 --- a/testdata/language-features/basic-list/list16.reject.out +++ b/testdata/language-features/basic-list/list16.reject.out | |||
@@ -1,16 +1,16 @@ | |||
1 | type error: can not unify | 1 | type error: can not unify |
2 | [32m['Char][0m | 2 | ['Char] |
3 | with | 3 | with |
4 | [32m'Char[0m | 4 | 'Char |
5 | 5 | ||
6 | in testdata/language-features/basic-list/list16.reject.lc:1:13: | 6 | in testdata/language-features/basic-list/list16.reject.lc:1:13: |
7 | value = 'h':'i' | 7 | value = 'h':'i' |
8 | ^^^ | 8 | ^^^ |
9 | ------------ trace | 9 | ------------ trace |
10 | !type error: can not unify | 10 | !type error: can not unify |
11 | [32m['Char][0m | 11 | ['Char] |
12 | with | 12 | with |
13 | [32m'Char[0m | 13 | 'Char |
14 | 14 | ||
15 | in testdata/language-features/basic-list/list16.reject.lc:1:13: | 15 | in testdata/language-features/basic-list/list16.reject.lc:1:13: |
16 | value = 'h':'i' | 16 | value = 'h':'i' |
diff --git a/testdata/language-features/basic-list/listcomp08.reject.out b/testdata/language-features/basic-list/listcomp08.reject.out index 6ecdfd71..1313a611 100644 --- a/testdata/language-features/basic-list/listcomp08.reject.out +++ b/testdata/language-features/basic-list/listcomp08.reject.out | |||
@@ -1,16 +1,16 @@ | |||
1 | type error: can not unify | 1 | type error: can not unify |
2 | [32m'Bool[0m | 2 | 'Bool |
3 | with | 3 | with |
4 | [32m'String[0m | 4 | 'String |
5 | 5 | ||
6 | in testdata/language-features/basic-list/listcomp08.reject.lc:1:23: | 6 | in testdata/language-features/basic-list/listcomp08.reject.lc:1:23: |
7 | value = [x | x <- [], "not Bool"] | 7 | value = [x | x <- [], "not Bool"] |
8 | ^^^^^^^^^^ | 8 | ^^^^^^^^^^ |
9 | ------------ trace | 9 | ------------ trace |
10 | !type error: can not unify | 10 | !type error: can not unify |
11 | [32m'Bool[0m | 11 | 'Bool |
12 | with | 12 | with |
13 | [32m'String[0m | 13 | 'String |
14 | 14 | ||
15 | in testdata/language-features/basic-list/listcomp08.reject.lc:1:23: | 15 | in testdata/language-features/basic-list/listcomp08.reject.lc:1:23: |
16 | value = [x | x <- [], "not Bool"] | 16 | value = [x | x <- [], "not Bool"] |
diff --git a/testdata/language-features/basic-values/case04.reject.out b/testdata/language-features/basic-values/case04.reject.out index 00cb4f39..55011f4d 100644 --- a/testdata/language-features/basic-values/case04.reject.out +++ b/testdata/language-features/basic-values/case04.reject.out | |||
@@ -1,16 +1,16 @@ | |||
1 | type error: can not unify | 1 | type error: can not unify |
2 | [32m()[0m | 2 | () |
3 | with | 3 | with |
4 | [32m'Char[0m | 4 | 'Char |
5 | 5 | ||
6 | in testdata/language-features/basic-values/case04.reject.lc:2:8: | 6 | in testdata/language-features/basic-values/case04.reject.lc:2:8: |
7 | 1 -> '1' | 7 | 1 -> '1' |
8 | ^^^ | 8 | ^^^ |
9 | ------------ trace | 9 | ------------ trace |
10 | !type error: can not unify | 10 | !type error: can not unify |
11 | [32m()[0m | 11 | () |
12 | with | 12 | with |
13 | [32m'Char[0m | 13 | 'Char |
14 | 14 | ||
15 | in testdata/language-features/basic-values/case04.reject.lc:2:8: | 15 | in testdata/language-features/basic-values/case04.reject.lc:2:8: |
16 | 1 -> '1' | 16 | 1 -> '1' |
diff --git a/testdata/language-features/basic-values/if03.reject.out b/testdata/language-features/basic-values/if03.reject.out index 9ba86d9c..d72492c4 100644 --- a/testdata/language-features/basic-values/if03.reject.out +++ b/testdata/language-features/basic-values/if03.reject.out | |||
@@ -1,16 +1,16 @@ | |||
1 | type error: can not unify | 1 | type error: can not unify |
2 | [32m'Bool[0m | 2 | 'Bool |
3 | with | 3 | with |
4 | [32m()[0m | 4 | () |
5 | 5 | ||
6 | in testdata/language-features/basic-values/if03.reject.lc:1:13: | 6 | in testdata/language-features/basic-values/if03.reject.lc:1:13: |
7 | value1 = if () then () else () | 7 | value1 = if () then () else () |
8 | ^^ | 8 | ^^ |
9 | ------------ trace | 9 | ------------ trace |
10 | !type error: can not unify | 10 | !type error: can not unify |
11 | [32m'Bool[0m | 11 | 'Bool |
12 | with | 12 | with |
13 | [32m()[0m | 13 | () |
14 | 14 | ||
15 | in testdata/language-features/basic-values/if03.reject.lc:1:13: | 15 | in testdata/language-features/basic-values/if03.reject.lc:1:13: |
16 | value1 = if () then () else () | 16 | value1 = if () then () else () |
diff --git a/testdata/language-features/basic-values/if04.reject.out b/testdata/language-features/basic-values/if04.reject.out index c0df8c35..795be098 100644 --- a/testdata/language-features/basic-values/if04.reject.out +++ b/testdata/language-features/basic-values/if04.reject.out | |||
@@ -1,16 +1,16 @@ | |||
1 | type error: can not unify | 1 | type error: can not unify |
2 | [32m()[0m | 2 | () |
3 | with | 3 | with |
4 | [32m'Char[0m | 4 | 'Char |
5 | 5 | ||
6 | in testdata/language-features/basic-values/if04.reject.lc:1:31: | 6 | in testdata/language-features/basic-values/if04.reject.lc:1:31: |
7 | value1 = if True then () else '_' | 7 | value1 = if True then () else '_' |
8 | ^^^ | 8 | ^^^ |
9 | ------------ trace | 9 | ------------ trace |
10 | !type error: can not unify | 10 | !type error: can not unify |
11 | [32m()[0m | 11 | () |
12 | with | 12 | with |
13 | [32m'Char[0m | 13 | 'Char |
14 | 14 | ||
15 | in testdata/language-features/basic-values/if04.reject.lc:1:31: | 15 | in testdata/language-features/basic-values/if04.reject.lc:1:31: |
16 | value1 = if True then () else '_' | 16 | value1 = if True then () else '_' |
diff --git a/testdata/language-features/guard/guard02.reject.out b/testdata/language-features/guard/guard02.reject.out index c46ac690..262f63a1 100644 --- a/testdata/language-features/guard/guard02.reject.out +++ b/testdata/language-features/guard/guard02.reject.out | |||
@@ -1,16 +1,16 @@ | |||
1 | type error: can not unify | 1 | type error: can not unify |
2 | [32m'String[0m | 2 | 'String |
3 | with | 3 | with |
4 | [32m()[0m | 4 | () |
5 | 5 | ||
6 | in testdata/language-features/guard/guard02.reject.lc:2:12: | 6 | in testdata/language-features/guard/guard02.reject.lc:2:12: |
7 | | True = () | 7 | | True = () |
8 | ^^ | 8 | ^^ |
9 | ------------ trace | 9 | ------------ trace |
10 | !type error: can not unify | 10 | !type error: can not unify |
11 | [32m'String[0m | 11 | 'String |
12 | with | 12 | with |
13 | [32m()[0m | 13 | () |
14 | 14 | ||
15 | in testdata/language-features/guard/guard02.reject.lc:2:12: | 15 | in testdata/language-features/guard/guard02.reject.lc:2:12: |
16 | | True = () | 16 | | True = () |
diff --git a/testdata/language-features/guard/guard05.reject.out b/testdata/language-features/guard/guard05.reject.out index fa30af80..07cea5f5 100644 --- a/testdata/language-features/guard/guard05.reject.out +++ b/testdata/language-features/guard/guard05.reject.out | |||
@@ -1,16 +1,16 @@ | |||
1 | type error: can not unify | 1 | type error: can not unify |
2 | [32m'Bool[0m | 2 | 'Bool |
3 | with | 3 | with |
4 | [32m()[0m | 4 | () |
5 | 5 | ||
6 | in testdata/language-features/guard/guard05.reject.lc:1:9: | 6 | in testdata/language-features/guard/guard05.reject.lc:1:9: |
7 | value | () = "wrong" | 7 | value | () = "wrong" |
8 | ^^ | 8 | ^^ |
9 | ------------ trace | 9 | ------------ trace |
10 | !type error: can not unify | 10 | !type error: can not unify |
11 | [32m'Bool[0m | 11 | 'Bool |
12 | with | 12 | with |
13 | [32m()[0m | 13 | () |
14 | 14 | ||
15 | in testdata/language-features/guard/guard05.reject.lc:1:9: | 15 | in testdata/language-features/guard/guard05.reject.lc:1:9: |
16 | value | () = "wrong" | 16 | value | () = "wrong" |
diff --git a/testdata/language-features/guard/guard12.reject.out b/testdata/language-features/guard/guard12.reject.out index 7ac38fa8..1225b2b3 100644 --- a/testdata/language-features/guard/guard12.reject.out +++ b/testdata/language-features/guard/guard12.reject.out | |||
@@ -1,16 +1,16 @@ | |||
1 | type error: can not unify | 1 | type error: can not unify |
2 | [32m'Char[0m | 2 | 'Char |
3 | with | 3 | with |
4 | [32m()[0m | 4 | () |
5 | 5 | ||
6 | in testdata/language-features/guard/guard12.reject.lc:1:13: | 6 | in testdata/language-features/guard/guard12.reject.lc:1:13: |
7 | fun x | x = () | otherwise = 'a' | 7 | fun x | x = () | otherwise = 'a' |
8 | ^^ | 8 | ^^ |
9 | ------------ trace | 9 | ------------ trace |
10 | !type error: can not unify | 10 | !type error: can not unify |
11 | [32m'Char[0m | 11 | 'Char |
12 | with | 12 | with |
13 | [32m()[0m | 13 | () |
14 | 14 | ||
15 | in testdata/language-features/guard/guard12.reject.lc:1:13: | 15 | in testdata/language-features/guard/guard12.reject.lc:1:13: |
16 | fun x | x = () | otherwise = 'a' | 16 | fun x | x = () | otherwise = 'a' |
diff --git a/testdata/record01.reject.out b/testdata/record01.reject.out index 39ad1ab3..2f8fb3af 100644 --- a/testdata/record01.reject.out +++ b/testdata/record01.reject.out | |||
@@ -1,16 +1,16 @@ | |||
1 | type error: can not unify | 1 | type error: can not unify |
2 | [32m'FrameBuffer [32m_b[0;32m [32m_a[0;32m[0m | 2 | 'FrameBuffer _b _a |
3 | with | 3 | with |
4 | [32m'Float[0m | 4 | 'Float |
5 | 5 | ||
6 | in testdata/record01.reject.lc:26:15: | 6 | in testdata/record01.reject.lc:26:15: |
7 | in ScreenOut record.fieldA | 7 | in ScreenOut record.fieldA |
8 | ^^^^^^ | 8 | ^^^^^^ |
9 | ------------ trace | 9 | ------------ trace |
10 | !type error: can not unify | 10 | !type error: can not unify |
11 | [32m'FrameBuffer [32m_b[0;32m [32m_a[0;32m[0m | 11 | 'FrameBuffer _b _a |
12 | with | 12 | with |
13 | [32m'Float[0m | 13 | 'Float |
14 | 14 | ||
15 | in testdata/record01.reject.lc:26:15: | 15 | in testdata/record01.reject.lc:26:15: |
16 | in ScreenOut record.fieldA | 16 | in ScreenOut record.fieldA |
diff --git a/testdata/typesig.reject.out b/testdata/typesig.reject.out index 27b06da5..3e0ba61d 100644 --- a/testdata/typesig.reject.out +++ b/testdata/typesig.reject.out | |||
@@ -1,4 +1,4 @@ | |||
1 | focus checkMetas: \(a :: Type) -> (\b -> primFix a b) | 1 | focus checkMetas: \(a :: Type) -> ((\b -> primFix a b) :: (a -> a) -> a) |
2 | let a = Type in \(c :: Type) -> <<HERE>> | 2 | let a = Type in \(c :: Type) -> <<HERE>> |
3 | \(a :: Type ~ _a) (b :: _a ~ X) -> typeAnn _a (_rhs X) | 3 | \(a :: Type ~ _a) (b :: _a ~ X) -> typeAnn _a (_rhs X) |
4 | ------------ trace | 4 | ------------ trace |
@@ -6,7 +6,7 @@ focus checkMetas: \(a :: Type) -> (\b -> primFix a b) | |||
6 | X :: X | 6 | X :: X |
7 | case'X :: forall (a :: X -> Type) -> a 'X -> forall (b :: X) -> a b | 7 | case'X :: forall (a :: X -> Type) -> a 'X -> forall (b :: X) -> a b |
8 | match'X :: forall (a :: Type -> Type) -> a X -> forall b -> a b -> a b | 8 | match'X :: forall (a :: Type -> Type) -> a X -> forall b -> a b -> a b |
9 | !focus checkMetas: \(a :: Type) -> (\b -> primFix a b) | 9 | !focus checkMetas: \(a :: Type) -> ((\b -> primFix a b) :: (a -> a) -> a) |
10 | let a = Type in \(c :: Type) -> <<HERE>> | 10 | let a = Type in \(c :: Type) -> <<HERE>> |
11 | \(a :: Type ~ _a) (b :: _a ~ X) -> typeAnn _a (_rhs X) | 11 | \(a :: Type ~ _a) (b :: _a ~ X) -> typeAnn _a (_rhs X) |
12 | ------------ tooltips | 12 | ------------ tooltips |