summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/LambdaCube/Compiler.hs9
-rw-r--r--testdata/DepPrelude.wip.lc (renamed from testdata/later.ignore/DepPrelude.lc)0
-rw-r--r--testdata/ShadowMapping.wip.lc (renamed from testdata/later.ignore/ShadowMapping.lc)43
-rw-r--r--testdata/adhoc.reject.lc (renamed from testdata/reject.ignore/adhoc.reject.lc)0
-rw-r--r--testdata/adhoc.reject.out23
-rw-r--r--testdata/framebuffer02.reject.lc (renamed from testdata/reject.ignore/framebuffer02.reject.lc)0
-rw-r--r--testdata/framebuffer02.reject.out51
-rw-r--r--testdata/framebuffer03.reject.wip.lc (renamed from testdata/reject.ignore/framebuffer03.reject.lc)0
-rw-r--r--testdata/framebuffer03.reject.wip.out (renamed from testdata/reject.ignore/framebuffer03.reject.out)0
-rw-r--r--testdata/instantiate2.lc1
-rw-r--r--testdata/instantiate2.out1
-rw-r--r--testdata/later.ignore/DemoUtils.lc48
-rw-r--r--testdata/nameclash01.reject.lc (renamed from testdata/reject.ignore/nameclash01.reject.lc)0
-rw-r--r--testdata/nameclash01.reject.out22
-rw-r--r--testdata/record02.lc (renamed from testdata/later.ignore/record02.lc)0
-rw-r--r--testdata/record02.out1
-rw-r--r--testdata/reject.ignore/accumulate02.reject.lc12
-rw-r--r--testdata/reject.ignore/accumulate02.reject.out9
-rw-r--r--testdata/reject.ignore/accumulate03.reject.lc12
-rw-r--r--testdata/reject.ignore/accumulate03.reject.out10
-rw-r--r--testdata/reject.ignore/adhoc.reject.out7
-rw-r--r--testdata/reject.ignore/fragctx01.reject.lc11
-rw-r--r--testdata/reject.ignore/fragctx01.reject.out9
-rw-r--r--testdata/reject.ignore/fragctx02.reject.lc12
-rw-r--r--testdata/reject.ignore/fragctx02.reject.out11
-rw-r--r--testdata/reject.ignore/framebuffer01.reject.lc3
-rw-r--r--testdata/reject.ignore/framebuffer01.reject.out5
-rw-r--r--testdata/reject.ignore/framebuffer02.reject.out13
-rw-r--r--testdata/reject.ignore/instantiate.reject.lc1
-rw-r--r--testdata/reject.ignore/instantiate.reject.out6
-rw-r--r--testdata/reject.ignore/nameclash01.reject.out10
-rw-r--r--testdata/reject.ignore/rastctx01.reject.lc11
-rw-r--r--testdata/reject.ignore/rastctx01.reject.out9
-rw-r--r--testdata/reject.ignore/syntax01.reject.out3
-rw-r--r--testdata/reject.ignore/syntax02.reject.lc86
-rw-r--r--testdata/reject.ignore/syntax02.reject.out3
-rw-r--r--testdata/reject.ignore/typesigctx.reject.lc10
-rw-r--r--testdata/reject.ignore/typesigctx.reject.out3
-rw-r--r--testdata/syntax01.reject.lc (renamed from testdata/reject.ignore/syntax01.reject.lc)0
-rw-r--r--testdata/syntax01.reject.out3
-rw-r--r--testdata/typesigctx.reject.lc8
-rw-r--r--testdata/typesigctx.reject.out25
42 files changed, 160 insertions, 331 deletions
diff --git a/src/LambdaCube/Compiler.hs b/src/LambdaCube/Compiler.hs
index fbd2203e..7e28a3ad 100644
--- a/src/LambdaCube/Compiler.hs
+++ b/src/LambdaCube/Compiler.hs
@@ -124,11 +124,12 @@ ioFetch paths' imp n = do
124 let paths = paths' ++ [preludePath] 124 let paths = paths' ++ [preludePath]
125 find ((x, mn): xs) = liftIO (readFile' x) >>= maybe (find xs) (\src -> return (x, mn, liftIO src)) 125 find ((x, mn): xs) = liftIO (readFile' x) >>= maybe (find xs) (\src -> return (x, mn, liftIO src))
126 find [] = throwError $ show $ "can't find " <+> either (("lc file" <+>) . text) (("module" <+>) . text) n 126 find [] = throwError $ show $ "can't find " <+> either (("lc file" <+>) . text) (("module" <+>) . text) n
127 <+> "in path" <+> hsep (map text paths) 127 <+> "in path" <+> hsep (map text (paths' ++ ["<<installed-prelude-path>>"]{-todo-}))
128 lcModuleFile path = case n of
129 Left n -> (path </> n, fileNameToModuleName n)
130 Right n -> (path </> moduleNameToFileName n, n)
131 find $ nubBy ((==) `on` fst) $ map (first normalise . lcModuleFile) paths 128 find $ nubBy ((==) `on` fst) $ map (first normalise . lcModuleFile) paths
129 where
130 lcModuleFile path = case n of
131 Left n -> (path </> n, fileNameToModuleName n)
132 Right n -> (path </> moduleNameToFileName n, n)
132 133
133-------------------------------------------------------------------------------- 134--------------------------------------------------------------------------------
134 135
diff --git a/testdata/later.ignore/DepPrelude.lc b/testdata/DepPrelude.wip.lc
index facb4b7b..facb4b7b 100644
--- a/testdata/later.ignore/DepPrelude.lc
+++ b/testdata/DepPrelude.wip.lc
diff --git a/testdata/later.ignore/ShadowMapping.lc b/testdata/ShadowMapping.wip.lc
index 679f395f..e9a5f11a 100644
--- a/testdata/later.ignore/ShadowMapping.lc
+++ b/testdata/ShadowMapping.wip.lc
@@ -29,29 +29,28 @@ gaussFilter9 =
29blurCoefficients :: [(Float, Float)] 29blurCoefficients :: [(Float, Float)]
30blurCoefficients = gaussFilter9 30blurCoefficients = gaussFilter9
31 31
32blur :: [(Float, Float)] -> Image 1 (Color (Vec 4 Float)) -> FrameBuffer 1 (Color (Vec 4 Float)) 32blur :: [(Float, Float)] -> Image 1 ('Color (Vec 4 Float)) -> FrameBuffer 1 '[ 'Color (Vec 4 Float) ]
33blur coefficients img = filter1D dirH (PrjImage (filter1D dirV img)) 33blur coefficients img = filter1D dirH (PrjImage (filter1D dirV img))
34 where 34 where
35 dirH v = V2 (v / shadowMapSize) 0.0 35 dirH v = V2 (v / shadowMapSize) 0.0
36 dirV v = V2 0.0 (v / shadowMapSize) 36 dirV v = V2 0.0 (v / shadowMapSize)
37 37
38 filter1D :: (Float -> Vec 2 Float) -> Image 1 (Color (Vec 4 Float)) -> FrameBuffer 1 (Color (Vec 4 Float)) 38-- todo -- filter1D :: (Float -> Vec 2 Float) -> Image 1 ('Color (Vec 4 Float)) -> FrameBuffer 1 '[ 'Color (Vec 4 Float) ]
39 filter1D dir img = accumulate accCtx PassAll frag 39 filter1D dir img = accumulate accCtx frag
40 (Rasterize triangleCtx prims) clearBuf 40 (rasterizePrimitives triangleCtx ((NoPerspective)) prims) clearBuf
41 where 41 where
42 accCtx = accumulationContext 42 accCtx = ((ColorOp NoBlending (V4 True True True True)))
43 ((ColorOp NoBlending (V4 True True True True))) 43 clearBuf = FrameBuffer ((ColorImage @1 (V4 0 0 0 0.0)))
44 clearBuf = FrameBuffer (ColorImage @1 (V4 0 0 0 0.0)) 44-- vert :: Vec 2 Float -> VertexOut (Vec 2 Float)
45 vert :: Vec 2 Float -> VertexOut (Vec 2 Float) 45 vert ((uv)) = (pos, uv')
46 vert uv = VertexOut pos 1 () (NoPerspective uv')
47 where 46 where
48 uv' = uv *! 0.5 +! 0.5 47 uv' = uv *! 0.5 +! 0.5
49 pos = V4 uv%x uv%y 1.0 1.0 48 pos = V4 uv%x uv%y 1.0 1.0
50 49
51 prims = Transform vert (fetch "postSlot" (Attribute "position" :: Vec 2 Float)) 50 prims = mapPrimitives vert (fetch "postSlot" ((Attribute "position")) :: PrimitiveStream Triangle ((Vec 2 Float)))
52 51
53 frag :: FragmentShader (Vec 2 Float -> Color (Vec 4 Float)) 52-- frag :: FragmentShader (Vec 2 Float -> Color (Vec 4 Float))
54 frag = FragmentShader $ \uv -> sample 53 frag ((uv)) = ((sample))
55 where 54 where
56 tex = Texture2D (V2 shadowMapSize shadowMapSize) img 55 tex = Texture2D (V2 shadowMapSize shadowMapSize) img
57 smp = Sampler LinearFilter ClampToEdge tex 56 smp = Sampler LinearFilter ClampToEdge tex
@@ -59,31 +58,31 @@ blur coefficients img = filter1D dirH (PrjImage (filter1D dirV img))
59 | (ofs, coeff) <- coefficients 58 | (ofs, coeff) <- coefficients
60 ] 59 ]
61 60
62moments :: FrameBuffer 1 (Depth Float, Color (Vec 4 Float)) 61moments :: FrameBuffer 1 '[Depth Float, Color (Vec 4 Float)]
63moments = accumulate accCtx PassAll frag (Rasterize triangleCtx prims) clearBuf 62moments = accumulate accCtx frag (rasterizePrimitives triangleCtx ((Smooth)) prims) clearBuf
64 where 63 where
65 accCtx = accumulationContext (DepthOp Less True, ColorOp NoBlending (V4 True True True True)) 64 accCtx = (DepthOp Less True, ColorOp NoBlending (V4 True True True True))
66 clearBuf = FrameBuffer (DepthImage @1 1000, ColorImage @1 (V4 0.0 0.0 0.0 1.0{-todo: use 1-})) 65 clearBuf = FrameBuffer (DepthImage @1 1000, ColorImage @1 (V4 0.0 0.0 0.0 1.0{-todo: use 1-}))
67 66
68 lightMatrix = Uniform "lightMatrix" :: Mat 4 4 Float 67 lightMatrix = Uniform "lightMatrix" :: Mat 4 4 Float
69 modelMatrix = Uniform "modelMatrix" :: Mat 4 4 Float 68 modelMatrix = Uniform "modelMatrix" :: Mat 4 4 Float
70 69
71 vert :: Vec 3 Float -> VertexOut Float 70-- vert :: ((Vec 3 Float)) -> ((Float
72 vert pos = VertexOut lightPos 1 () (Smooth depth) 71 vert ((pos)) = (lightPos, depth)
73 where 72 where
74 lightPos = lightMatrix *. modelMatrix *. v3FToV4F pos 73 lightPos = lightMatrix *. modelMatrix *. v3FToV4F pos
75 depth = lightPos%z 74 depth = lightPos%z
76 75
77 prims = Transform vert (fetch "geometrySlot" Triangle (Attribute "position" :: Vec 3 Float)) 76 prims = mapPrimitives vert (fetch "geometrySlot" ((Attribute "position" :: Vec 3 Float)))
78 77
79 frag :: FragmentShader (Float -> (Depth Float,Color (Vec 4 Float))) 78-- frag :: Float -> (Depth Float,Color (Vec 4 Float))
80 frag = FragmentShaderRastDepth $ \depth -> (V4 moment1 moment2 0 1) 79 frag ((depth)) = (depth, V4 moment1 moment2 0 1)
81 where 80 where
82 dx = dFdx depth 81 dx = dFdx depth
83 dy = dFdy depth 82 dy = dFdy depth
84 moment1 = depth 83 moment1 = depth
85 moment2 = depth *! depth +! 0.25 *! (dx *! dx +! dy *! dy) 84 moment2 = depth *! depth +! 0.25 *! (dx *! dx +! dy *! dy)
86 85{-
87depth :: FrameBuffer 1 (Depth Float, Color (Vec 4 Float)) 86depth :: FrameBuffer 1 (Depth Float, Color (Vec 4 Float))
88depth = accumulate accCtx PassAll frag (Rasterize triangleCtx prims) clearBuf 87depth = accumulate accCtx PassAll frag (Rasterize triangleCtx prims) clearBuf
89 where 88 where
@@ -104,8 +103,6 @@ depth = accumulate accCtx PassAll frag (Rasterize triangleCtx prims) clearBuf
104 frag :: FragmentShader (Float -> (Depth Float, Color (Vec 4 Float))) 103 frag :: FragmentShader (Float -> (Depth Float, Color (Vec 4 Float)))
105 frag = FragmentShaderRastDepth $ \depth -> (V4 depth 0 0 1) 104 frag = FragmentShaderRastDepth $ \depth -> (V4 depth 0 0 1)
106 105
107failhere
108{- todo
109vsm :: FrameBuffer 1 (Depth Float, Color (Vec 4 Float)) 106vsm :: FrameBuffer 1 (Depth Float, Color (Vec 4 Float))
110vsm = accumulate accCtx PassAll frag (Rasterize triangleCtx prims) clearBuf 107vsm = accumulate accCtx PassAll frag (Rasterize triangleCtx prims) clearBuf
111 where 108 where
diff --git a/testdata/reject.ignore/adhoc.reject.lc b/testdata/adhoc.reject.lc
index 659029b6..659029b6 100644
--- a/testdata/reject.ignore/adhoc.reject.lc
+++ b/testdata/adhoc.reject.lc
diff --git a/testdata/adhoc.reject.out b/testdata/adhoc.reject.out
new file mode 100644
index 00000000..cd0ede7d
--- /dev/null
+++ b/testdata/adhoc.reject.out
@@ -0,0 +1,23 @@
1type error: no instance of 'Component on ???
2in testdata/adhoc.reject.lc:4:5:
3x = one :: Vec 4 A
4 ^^^
5
6------------ trace
7'A :: Type
8A :: 'A
9'ACase :: (b : 'A->Type) -> b A -> d:'A -> b d
10match'A :: (b : Type->Type) -> b 'A -> d:Type -> b d -> b d
11!type error: no instance of 'Component on ???
12in testdata/adhoc.reject.lc:4:5
13
14------------ tooltips
15testdata/adhoc.reject.lc 2:6-2:7 Type
16testdata/adhoc.reject.lc 2:6-2:11 Type
17testdata/adhoc.reject.lc 2:10-2:11 A
18testdata/adhoc.reject.lc 4:5-4:8 {a} -> {b : Component a}->a
19testdata/adhoc.reject.lc 4:12-4:15 Nat -> Type->Type
20testdata/adhoc.reject.lc 4:12-4:17 Type->Type
21testdata/adhoc.reject.lc 4:12-4:19 Type
22testdata/adhoc.reject.lc 4:16-4:17 V1
23testdata/adhoc.reject.lc 4:18-4:19 Type
diff --git a/testdata/reject.ignore/framebuffer02.reject.lc b/testdata/framebuffer02.reject.lc
index ab8504f6..ab8504f6 100644
--- a/testdata/reject.ignore/framebuffer02.reject.lc
+++ b/testdata/framebuffer02.reject.lc
diff --git a/testdata/framebuffer02.reject.out b/testdata/framebuffer02.reject.out
new file mode 100644
index 00000000..26f57b80
--- /dev/null
+++ b/testdata/framebuffer02.reject.out
@@ -0,0 +1,51 @@
1type error: can not unify
20
3with
41
5
6in testdata/framebuffer02.reject.lc:2:17:
7 let frame = FrameBuffer (colorImage1 (V4 0.0 0.0 0.4 1.0)
8 ,ColorImage @2 (V4 1.0 1.0 1.0 1.0)
9 ,colorImage1 1.0
10 )
11
12------------ trace
13!type error: can not unify
140
15with
161
17
18in testdata/framebuffer02.reject.lc:2:17
19
20------------ tooltips
21testdata/framebuffer02.reject.lc 2:17-2:28 {a : List Type} -> {b : 'sameLayerCounts a} -> HList a -> FrameBuffer (ImageLC ('head Type a)) ('map Type ImageSemantics ImageSem a)
22testdata/framebuffer02.reject.lc 2:17-5:30 FrameBuffer 1 ('map Type ImageSemantics ImageSem ('Cons (Image 1 ('Color (VecScalar 4 Float))) ('Cons (Image 2 ('Color (VecScalar 4 Float))) ('Cons (Image 1 ('Color (VecScalar 1 Float))) 'Nil))))
23testdata/framebuffer02.reject.lc 2:29-5:30 (Image 1 ('Color (VecScalar 4 Float)), Image 2 ('Color (VecScalar 4 Float)), Image 1 ('Color (VecScalar 1 Float)))
24testdata/framebuffer02.reject.lc 2:30-2:41 {a:Nat} -> {b} -> {c} -> {d : Num b} -> {e : c ~ VecScalar a b} -> c -> Image 1 ('Color c)
25testdata/framebuffer02.reject.lc 2:30-2:62 Image 1 ('Color (VecScalar 4 Float))
26testdata/framebuffer02.reject.lc 2:43-2:45 {a} -> a -> a -> a -> a -> VecS a 4
27testdata/framebuffer02.reject.lc 2:43-2:49 Float -> Float -> Float -> VecS Float 4
28testdata/framebuffer02.reject.lc 2:43-2:53 Float -> Float -> VecS Float 4
29testdata/framebuffer02.reject.lc 2:43-2:57 Float -> VecS Float 4
30testdata/framebuffer02.reject.lc 2:43-2:61 VecS Float 4
31testdata/framebuffer02.reject.lc 2:46-2:49 Float
32testdata/framebuffer02.reject.lc 2:50-2:53 Float
33testdata/framebuffer02.reject.lc 2:54-2:57 Float
34testdata/framebuffer02.reject.lc 2:58-2:61 Float
35testdata/framebuffer02.reject.lc 3:30-3:40 {a:Nat} -> {b:Nat} -> {c} -> {d} -> {e : Num c} -> {f : d ~ VecScalar b c} -> d -> Image a ('Color d)
36testdata/framebuffer02.reject.lc 3:30-3:43 {a:Nat} -> {b} -> {c} -> {d : Num b} -> {e : c ~ VecScalar a b} -> c -> Image 2 ('Color c)
37testdata/framebuffer02.reject.lc 3:30-3:64 Image 2 ('Color (VecScalar 4 Float))
38testdata/framebuffer02.reject.lc 3:30-4:45 (Image 2 ('Color (VecScalar 4 Float)), Image 1 ('Color (VecScalar 1 Float)))
39testdata/framebuffer02.reject.lc 3:42-3:43 V1
40testdata/framebuffer02.reject.lc 3:45-3:47 {a} -> a -> a -> a -> a -> VecS a 4
41testdata/framebuffer02.reject.lc 3:45-3:51 Float -> Float -> Float -> VecS Float 4
42testdata/framebuffer02.reject.lc 3:45-3:55 Float -> Float -> VecS Float 4
43testdata/framebuffer02.reject.lc 3:45-3:59 Float -> VecS Float 4
44testdata/framebuffer02.reject.lc 3:45-3:63 VecS Float 4
45testdata/framebuffer02.reject.lc 3:48-3:51 Float
46testdata/framebuffer02.reject.lc 3:52-3:55 Float
47testdata/framebuffer02.reject.lc 3:56-3:59 Float
48testdata/framebuffer02.reject.lc 3:60-3:63 Float
49testdata/framebuffer02.reject.lc 4:30-4:41 {a:Nat} -> {b} -> {c} -> {d : Num b} -> {e : c ~ VecScalar a b} -> c -> Image 1 ('Color c)
50testdata/framebuffer02.reject.lc 4:30-4:45 ((Image 1 ('Color (VecScalar 1 Float)))) | Image 1 ('Color (VecScalar 1 Float))
51testdata/framebuffer02.reject.lc 4:42-4:45 Float
diff --git a/testdata/reject.ignore/framebuffer03.reject.lc b/testdata/framebuffer03.reject.wip.lc
index 0cbfc28a..0cbfc28a 100644
--- a/testdata/reject.ignore/framebuffer03.reject.lc
+++ b/testdata/framebuffer03.reject.wip.lc
diff --git a/testdata/reject.ignore/framebuffer03.reject.out b/testdata/framebuffer03.reject.wip.out
index 3debfd51..3debfd51 100644
--- a/testdata/reject.ignore/framebuffer03.reject.out
+++ b/testdata/framebuffer03.reject.wip.out
diff --git a/testdata/instantiate2.lc b/testdata/instantiate2.lc
new file mode 100644
index 00000000..4f202b52
--- /dev/null
+++ b/testdata/instantiate2.lc
@@ -0,0 +1 @@
main = let f = (+) in (f (V2 1.0 2.0) (V2 2.3 3.4), f 1.0 2.0)
diff --git a/testdata/instantiate2.out b/testdata/instantiate2.out
new file mode 100644
index 00000000..b7d32356
--- /dev/null
+++ b/testdata/instantiate2.out
@@ -0,0 +1 @@
(+ ('VecS 'Float 2) TT (V2 1.0 2.0) (V2 2.3 3.4), 3.0) \ No newline at end of file
diff --git a/testdata/later.ignore/DemoUtils.lc b/testdata/later.ignore/DemoUtils.lc
deleted file mode 100644
index 0f60fdd4..00000000
--- a/testdata/later.ignore/DemoUtils.lc
+++ /dev/null
@@ -1,48 +0,0 @@
1module DemoUtils
2 ( module DemoUtils
3 , module Prelude
4 ) where
5
6time = Uniform "Time" :: Float
7
8--v3v4 = PrimV3FToV4F
9
10-- example combinators
11image color = FrameBuffer (DepthImage @1 1000.0, ColorImage @1 color)
12
13triangleRasterCtx = TriangleCtx CullNone PolygonFill NoOffset LastVertex
14colorFragmentCtx = accumulationContext (DepthOp Less True, ColorOp NoBlending (V4 True True True True))
15
16rasterizeWith = Rasterize
17triangles = triangleRasterCtx
18
19cubeVertexStream = fetch "stream4" (Attribute "position4" :: ((Vec 4 Float)))
20mapFragments s fs bg = accumulate colorFragmentCtx PassAll (FragmentShaderRastDepth $ \((a)) -> ((fs a))) s bg
21transform s f = Transform (\v -> VertexOut (f v) 1.0 () (Smooth v)) s
22
23cube v f bg = (cubeVertexStream -- cube vertices
24 `transform` v -- scale them
25 & rasterizeWith triangles -- rasterize
26 `mapFragments` f) bg
27
28
29
30withCoords f a = f (a%x) (a%y)
31
32fragmentTest f = quadVertexStream
33 `transformQ` id
34 & rasterizeWith triangles
35 `mapFragmentsQ` withCoords f
36 where
37 clearQ = FrameBuffer $ ColorImage @1 $ V4 1 0 0 0.5
38
39 colorFragmentCtxQ = accumulationContext ((ColorOp NoBlending (V4 True True True True)))
40 mapFragmentsQ s fs = accumulate colorFragmentCtxQ PassAll (FragmentShader $ \((a)) -> ((fs a))) s clearQ
41
42 quadVertexStream = fetch "quad" Triangle (Attribute "position" :: Vec 2 Float)
43
44 tr :: Vec 2 Float -> Vec 4 Float
45 tr a = V4 a%x a%y 1 1
46
47 transformQ s f = Transform (\v -> VertexOut (tr $ f v ) 1 () (Smooth v)) s
48
diff --git a/testdata/reject.ignore/nameclash01.reject.lc b/testdata/nameclash01.reject.lc
index 18776b15..18776b15 100644
--- a/testdata/reject.ignore/nameclash01.reject.lc
+++ b/testdata/nameclash01.reject.lc
diff --git a/testdata/nameclash01.reject.out b/testdata/nameclash01.reject.out
new file mode 100644
index 00000000..a3bdd3c9
--- /dev/null
+++ b/testdata/nameclash01.reject.out
@@ -0,0 +1,22 @@
1type error: can not unify
2'HList V1
3with
4'Image 1 (Color ('VecScalar 1 'Float))
5
6in testdata/nameclash01.reject.lc:2:48:
7 let FrameBuffer = FrameBuffer (colorImage1 1.0)
8 ^^^
9
10------------ trace
11!type error: can not unify
12'HList V1
13with
14'Image 1 (Color ('VecScalar 1 'Float))
15
16in testdata/nameclash01.reject.lc:2:48
17
18------------ tooltips
19testdata/nameclash01.reject.lc 2:23-2:34 {a : List Type} -> {b : 'sameLayerCounts a} -> HList a -> FrameBuffer (ImageLC ('head Type a)) ('map Type ImageSemantics ImageSem a)
20testdata/nameclash01.reject.lc 2:36-2:47 {a:Nat} -> {b} -> {c} -> {d : Num b} -> {e : c ~ VecScalar a b} -> c -> Image 1 ('Color c)
21testdata/nameclash01.reject.lc 2:36-2:51 Image 1 ('Color (VecScalar 1 Float))
22testdata/nameclash01.reject.lc 2:48-2:51 Float
diff --git a/testdata/later.ignore/record02.lc b/testdata/record02.lc
index 1e322d23..1e322d23 100644
--- a/testdata/later.ignore/record02.lc
+++ b/testdata/record02.lc
diff --git a/testdata/record02.out b/testdata/record02.out
new file mode 100644
index 00000000..65af037c
--- /dev/null
+++ b/testdata/record02.out
@@ -0,0 +1 @@
True \ No newline at end of file
diff --git a/testdata/reject.ignore/accumulate02.reject.lc b/testdata/reject.ignore/accumulate02.reject.lc
deleted file mode 100644
index 7b55d585..00000000
--- a/testdata/reject.ignore/accumulate02.reject.lc
+++ /dev/null
@@ -1,12 +0,0 @@
1main = let
2 emptyFB = FrameBuffer ((colorImage1 (V4 0.0 0.0 0.4 1.0))
3 rasterCtx = TriangleCtx CullNone PolygonFill NoOffset LastVertex
4 colorOp = ColorOp NoBlending (V4 True True True True)
5 fragmentCtx = accumulationContext colorOp
6 vertexShader ((v)) = VertexOut v 1.0 () (Smooth v)
7 vertexStream = fetch "stream" (Attribute "position" :: ((Vec 4 Float)))
8 primitiveStream = Transform vertexShader vertexStream
9 fragmentStream = Rasterize rasterCtx primitiveStream
10 fragmentShader = FragmentShader $ \((v)) -> 1.0
11 frame = accumulate fragmentCtx PassAll fragmentShader fragmentStream emptyFB
12 in ScreenOut frame
diff --git a/testdata/reject.ignore/accumulate02.reject.out b/testdata/reject.ignore/accumulate02.reject.out
deleted file mode 100644
index 6d3f304e..00000000
--- a/testdata/reject.ignore/accumulate02.reject.out
+++ /dev/null
@@ -1,9 +0,0 @@
1during addUnifs
2position: "./tests/reject/accumulate02.lc" (line 11, column 23) - "./tests/reject/accumulate02.lc" (line 11, column 68)
3 frame = Accumulate fragmentCtx PassAll fragmentShader fragmentStream emptyFB
4 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5cannot unify Vec 4 t00053 with Float
6----------- equations
7~~~
8t00049 -> FragmentOut (Color (Vec 4 t00053))
9t00056 -> FragmentOut (Color Float) \ No newline at end of file
diff --git a/testdata/reject.ignore/accumulate03.reject.lc b/testdata/reject.ignore/accumulate03.reject.lc
deleted file mode 100644
index 0cb16566..00000000
--- a/testdata/reject.ignore/accumulate03.reject.lc
+++ /dev/null
@@ -1,12 +0,0 @@
1main = let
2 emptyFB = FrameBuffer (colorImage1 (V4 0.0 0.0 0.4 1.0),colorImage1 0.1)
3 rasterCtx = TriangleCtx CullNone PolygonFill NoOffset LastVertex
4 colorOp = ColorOp NoBlending (V4 True True True True)
5 fragmentCtx = accumulationContext (colorOp,ColorOp NoBlending True)
6 vertexShader ((v)) = VertexOut v 1.0 () (Smooth v)
7 vertexStream = fetch "stream" (Attribute "position" :: ((Vec 4 Float)))
8 primitiveStream = Transform vertexShader vertexStream
9 fragmentStream = Rasterize rasterCtx primitiveStream
10 fragmentShader = FragmentShader $ \((v)) -> 1.0
11 frame = accumulate fragmentCtx PassAll fragmentShader fragmentStream emptyFB
12 in ScreenOut frame
diff --git a/testdata/reject.ignore/accumulate03.reject.out b/testdata/reject.ignore/accumulate03.reject.out
deleted file mode 100644
index 620d50f3..00000000
--- a/testdata/reject.ignore/accumulate03.reject.out
+++ /dev/null
@@ -1,10 +0,0 @@
1during addUnifs
2position: "./tests/reject/accumulate03.lc" (line 11, column 23) - "./tests/reject/accumulate03.lc" (line 11, column 68)
3 frame = Accumulate fragmentCtx PassAll fragmentShader fragmentStream emptyFB
4 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5cannot unify (Color (Vec 4 t00066),Color t00067)
6with Color Float
7----------- equations
8~~~
9t00062 -> FragmentOut (Color (Vec 4 t00066),Color t00067)
10t00072 -> FragmentOut (Color Float) \ No newline at end of file
diff --git a/testdata/reject.ignore/adhoc.reject.out b/testdata/reject.ignore/adhoc.reject.out
deleted file mode 100644
index 278aba16..00000000
--- a/testdata/reject.ignore/adhoc.reject.out
+++ /dev/null
@@ -1,7 +0,0 @@
1during inst x
2position: "./tests/reject/adhoc.lc" (line 4, column 1) - "./tests/reject/adhoc.lc" (line 4, column 23)
3x = oneComp :: Vec 4 A
4^^^^^^^^^^^^^^^^^^^^^^
5during ambcheck x ambiguous type:
6(a :: Component (Vec 4 A)) => Vec 4 A
7problematic vars: [(t00004,Component (Vec 4 A))] \ No newline at end of file
diff --git a/testdata/reject.ignore/fragctx01.reject.lc b/testdata/reject.ignore/fragctx01.reject.lc
deleted file mode 100644
index d3b60e00..00000000
--- a/testdata/reject.ignore/fragctx01.reject.lc
+++ /dev/null
@@ -1,11 +0,0 @@
1main = let
2 emptyFB = FrameBuffer ((colorImage1 (V4 0.0 0.0 0.4 1.0))
3 rasterCtx = TriangleCtx CullNone PolygonFill NoOffset LastVertex
4 fragmentCtx = accumulationContext (DepthOp Less False) -- ERROR
5 vertexShader ((v)) = VertexOut v 1.0 () (Smooth v)
6 vertexStream = fetch "stream" (Attribute "position" :: ((Vec 4 Float)))
7 primitiveStream = Transform vertexShader vertexStream
8 fragmentStream = Rasterize rasterCtx primitiveStream
9 fragmentShader = FragmentShader $ \((v)) -> (V4 1.0 0.0 0.0 1.0)
10 frame = accumulate fragmentCtx PassAll fragmentShader fragmentStream emptyFB
11 in ScreenOut frame
diff --git a/testdata/reject.ignore/fragctx01.reject.out b/testdata/reject.ignore/fragctx01.reject.out
deleted file mode 100644
index 5451c6b1..00000000
--- a/testdata/reject.ignore/fragctx01.reject.out
+++ /dev/null
@@ -1,9 +0,0 @@
1during addUnifs
2position: "./tests/reject/fragctx01.lc" (line 10, column 23) - "./tests/reject/fragctx01.lc" (line 10, column 68)
3 frame = Accumulate fragmentCtx PassAll fragmentShader fragmentStream emptyFB
4 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5cannot unify Depth with Color
6----------- equations
7~~~
8t00039 -> FragmentOut (Depth Float)
9t00044 -> FragmentOut (Color (Vec 4 Float)) \ No newline at end of file
diff --git a/testdata/reject.ignore/fragctx02.reject.lc b/testdata/reject.ignore/fragctx02.reject.lc
deleted file mode 100644
index 37157d98..00000000
--- a/testdata/reject.ignore/fragctx02.reject.lc
+++ /dev/null
@@ -1,12 +0,0 @@
1main = let
2 emptyFB = FrameBuffer ((colorImage1 (V4 0.0 0.0 0.4 1.0))
3 rasterCtx = TriangleCtx CullNone PolygonFill NoOffset LastVertex
4 colorOp = ColorOp NoBlending (V4 True True True True)
5 fragmentCtx = accumulationContext (colorOp,colorOp) -- ERROR
6 vertexShader ((v)) = VertexOut v 1.0 () (Smooth v)
7 vertexStream = fetch "stream" (Attribute "position" :: ((Vec 4 Float)))
8 primitiveStream = Transform vertexShader vertexStream
9 fragmentStream = Rasterize rasterCtx primitiveStream
10 fragmentShader = FragmentShader $ \((v)) -> (V4 1.0 0.0 0.0 1.0)
11 frame = accumulate fragmentCtx PassAll fragmentShader fragmentStream emptyFB
12 in ScreenOut frame
diff --git a/testdata/reject.ignore/fragctx02.reject.out b/testdata/reject.ignore/fragctx02.reject.out
deleted file mode 100644
index e2265a19..00000000
--- a/testdata/reject.ignore/fragctx02.reject.out
+++ /dev/null
@@ -1,11 +0,0 @@
1during addUnifs
2position: "./tests/reject/fragctx02.lc" (line 11, column 23) - "./tests/reject/fragctx02.lc" (line 11, column 68)
3 frame = Accumulate fragmentCtx PassAll fragmentShader fragmentStream emptyFB
4 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5cannot unify (Color (Vec 4 t00056),Color (Vec 4 t00057))
6with Color (Vec 4 Float)
7----------- equations
8~~~
9t00052
10-> FragmentOut (Color (Vec 4 t00056),Color (Vec 4 t00057))
11t00061 -> FragmentOut (Color (Vec 4 Float)) \ No newline at end of file
diff --git a/testdata/reject.ignore/framebuffer01.reject.lc b/testdata/reject.ignore/framebuffer01.reject.lc
deleted file mode 100644
index f39b24ff..00000000
--- a/testdata/reject.ignore/framebuffer01.reject.lc
+++ /dev/null
@@ -1,3 +0,0 @@
1main =
2 let frame = FrameBuffer (ColorImage @1 @2)
3 in ScreenOut frame
diff --git a/testdata/reject.ignore/framebuffer01.reject.out b/testdata/reject.ignore/framebuffer01.reject.out
deleted file mode 100644
index b74a71d3..00000000
--- a/testdata/reject.ignore/framebuffer01.reject.out
+++ /dev/null
@@ -1,5 +0,0 @@
1during type inference of ColorImage @ 1 @ 2
2position: "./tests/reject/framebuffer01.lc" (line 2, column 30) - "./tests/reject/framebuffer01.lc" (line 2, column 46)
3 let frame = FrameBuffer (ColorImage @1 @2)
4 ^^^^^^^^^^^^^^^^
5can't unify t00007 -> Image 1 (Color t00007) with forall \ No newline at end of file
diff --git a/testdata/reject.ignore/framebuffer02.reject.out b/testdata/reject.ignore/framebuffer02.reject.out
deleted file mode 100644
index 9de05a09..00000000
--- a/testdata/reject.ignore/framebuffer02.reject.out
+++ /dev/null
@@ -1,13 +0,0 @@
1during type inference of FrameBuffer (colorImage1 (V4 0.0 0.0 0.4 1.0)
2 ,ColorImage @ 2 (V4 1.0 1.0 1.0 1.0)
3 ,colorImage1 1.0)
4position: "./tests/reject/framebuffer02.lc" (line 2, column 17) - "./tests/reject/framebuffer02.lc" (line 5, column 30)
5 let frame = FrameBuffer (colorImage1 (V4 0.0 0.0 0.4 1.0)
6 ,ColorImage @2 (V4 1.0 1.0 1.0 1.0)
7 ,colorImage1 1.0
8 )
9error during reduction of
10FrameBuffer t00004 t00003 ~ TFFrameBuffer (Image 1 (Color (Vec 4 Float))
11 ,Image 2 (Color (Vec 4 Float))
12 ,Image 1 (Color Float))
13frambuffer number of layers differ \ No newline at end of file
diff --git a/testdata/reject.ignore/instantiate.reject.lc b/testdata/reject.ignore/instantiate.reject.lc
deleted file mode 100644
index 4e3bcfbb..00000000
--- a/testdata/reject.ignore/instantiate.reject.lc
+++ /dev/null
@@ -1 +0,0 @@
1main = let f = PrimAdd in (f (V2 1.0 2.0) (V2 2.3 3.4), f 1.0 2.0)
diff --git a/testdata/reject.ignore/instantiate.reject.out b/testdata/reject.ignore/instantiate.reject.out
deleted file mode 100644
index 8aac2153..00000000
--- a/testdata/reject.ignore/instantiate.reject.out
+++ /dev/null
@@ -1,6 +0,0 @@
1during type inference of f 1.0
2position: "./tests/reject/instantiate.lc" (line 1, column 57) - "./tests/reject/instantiate.lc" (line 1, column 62)
3main = let f = PrimAdd in (f (V2 1.0 2.0) (V2 2.3 3.4), f 1.0 2.0)
4 ^^^^^
5error during reduction of t00013 ~ MatVecElem Float
6no instance matvecelem Float \ No newline at end of file
diff --git a/testdata/reject.ignore/nameclash01.reject.out b/testdata/reject.ignore/nameclash01.reject.out
deleted file mode 100644
index cffd5eda..00000000
--- a/testdata/reject.ignore/nameclash01.reject.out
+++ /dev/null
@@ -1,10 +0,0 @@
1during addUnifs
2position: "./tests/reject/nameclash01.lc" (line 3, column 8) - "./tests/reject/nameclash01.lc" (line 3, column 29)
3 in ScreenOut FrameBuffer
4 ^^^^^^^^^^^^^^^^^^^^^
5cannot unify FrameBuffer t00008 t00007 with t00009
6-> FrameBuffer t00011 t00010
7----------- equations
8~~~
9FrameBuffer t00008 t00007
10t00009 -> FrameBuffer t00011 t00010 \ No newline at end of file
diff --git a/testdata/reject.ignore/rastctx01.reject.lc b/testdata/reject.ignore/rastctx01.reject.lc
deleted file mode 100644
index 27776d36..00000000
--- a/testdata/reject.ignore/rastctx01.reject.lc
+++ /dev/null
@@ -1,11 +0,0 @@
1main = let
2 emptyFB = FrameBuffer ((colorImage1 (V4 0.0 0.0 0.4 1.0))
3 rasterCtx = TriangleCtx CullNone PolygonFill NoOffset LastVertex
4 fragmentCtx = accumulationContext ((ColorOp NoBlending (V4 True True True True)))
5 vertexShader ((v)) = VertexOut v 1.0 () (Smooth v)
6 vertexStream = fetch "stream" (Attribute "position" :: ((Vec 4 Float)))
7 primitiveStream = Transform vertexShader vertexStream
8 fragmentStream = Rasterize rasterCtx primitiveStream
9 fragmentShader = FragmentShader $ \((v)) -> (V4 1.0 0.0 0.0 1.0)
10 frame = accumulate fragmentCtx PassAll fragmentShader fragmentStream emptyFB
11 in ScreenOut frame
diff --git a/testdata/reject.ignore/rastctx01.reject.out b/testdata/reject.ignore/rastctx01.reject.out
deleted file mode 100644
index 1d3f5a13..00000000
--- a/testdata/reject.ignore/rastctx01.reject.out
+++ /dev/null
@@ -1,9 +0,0 @@
1during addUnifs
2position: "./tests/reject/rastctx01.lc" (line 8, column 23) - "./tests/reject/rastctx01.lc" (line 8, column 58)
3 fragmentStream = Rasterize rasterCtx primitiveStream
4 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5cannot unify Triangle with Line
6----------- equations
7~~~
8PrimitiveStream Triangle t00041 t00039
9PrimitiveStream Line 1 (Vec 4 Float) \ No newline at end of file
diff --git a/testdata/reject.ignore/syntax01.reject.out b/testdata/reject.ignore/syntax01.reject.out
deleted file mode 100644
index aa4e96db..00000000
--- a/testdata/reject.ignore/syntax01.reject.out
+++ /dev/null
@@ -1,3 +0,0 @@
1"./tests/reject/syntax01.lc" (line 3, column 2):
2expecting function definition or value definition
3Invalid indentation. Found a token at indentation 1. Expecting a token at an indentation between 2 and 9223372036854775807.IndentStream {indentationState = IndentationState {minIndentation = 2, maxIndentation = 9223372036854775807, absMode = True, tokenRel = Ge}, tokenStream = ""} \ No newline at end of file
diff --git a/testdata/reject.ignore/syntax02.reject.lc b/testdata/reject.ignore/syntax02.reject.lc
deleted file mode 100644
index 868168a9..00000000
--- a/testdata/reject.ignore/syntax02.reject.lc
+++ /dev/null
@@ -1,86 +0,0 @@
1module Stunts.Main (id,(***)) where
2
3import A(a,b)
4import A.B
5
6data Bool = True | False
7
8data Maybe a
9 = Nothing
10 | Just a
11
12main :: Screen
13main = screen (A q w e (Just t n1)) a B (a B (q))
14
15fun a@(B a@(C c)) = let
16 q = a
17 where
18 a = c ()
19 p = A c
20 r = case a (A c a) q of
21 _ -> ()
22 _ -> ()
23 in (a,c)
24
25author =
26 { name: "Phil"
27 , interests: ["Functional Programming", "JavaScript"]
28 }
29
30lambdaFun = \_ a b (Just _) _ -> a ()
31
32r = case (a (A c a) q) of
33 _ -> if c :: Bool then () else ()
34 _ -> ()
35
36(*) :: Screen
37
38one :: Int
39one = n1 :: Int
40
41infix 5 ...
42
43($) :: forall a b. (a -> b) -> a -> b
44($) f x = f x
45
46
47foldStream :: forall l e m. (Stream l, Monoid m) => (e -> m) -> l -> m
48
49showPerson :: forall r. { first :: String, last :: String | r} -> String
50
51type Entry = { firstName :: String, lastName :: String, phone :: String }
52
53getPhone :: Entry -> String
54--TODO:
55{-
56getPhone e = e.phone
57
58setX :: Number -> Point -> Point
59setX val point = point { x = val }
60-}
61type PhoneBook = List Entry
62
63class Functor f where
64 (<$>) :: forall a b. (a -> b) -> f a -> f b
65
66instance Functor State where
67 (<$>) f a = a
68
69class Foldable f where
70 foldr :: forall a b. (a -> b -> b) -> b -> f a -> b
71 foldl :: forall a b. (b -> a -> b) -> b -> f a -> b
72 foldMap :: forall a m. (Monoid m) => (a -> m) -> f a -> m
73
74class Partial a
75
76head :: forall a. (Partial a) => [a] -> a
77
78class (Monoid m) => Action m where
79 act :: m -> a -> a
80
81{-
82 - add the remained syntax parts
83 - write an example using lambdacube operations,
84 e.g. self containing rotating cube (CPU + GPU + Data, only with time input nothing else)
85 HINT: feedback between frames is out of scope at first, because it requires FRP features
86-}
diff --git a/testdata/reject.ignore/syntax02.reject.out b/testdata/reject.ignore/syntax02.reject.out
deleted file mode 100644
index 3a38a92d..00000000
--- a/testdata/reject.ignore/syntax02.reject.out
+++ /dev/null
@@ -1,3 +0,0 @@
1
2no file position
3can't find module ./tests/reject/A.lc ./tests/accept/A.lc \ No newline at end of file
diff --git a/testdata/reject.ignore/typesigctx.reject.lc b/testdata/reject.ignore/typesigctx.reject.lc
deleted file mode 100644
index 0c5f00fe..00000000
--- a/testdata/reject.ignore/typesigctx.reject.lc
+++ /dev/null
@@ -1,10 +0,0 @@
1{-# LANGUAGE NoImplicitPrelude #-}
2
3data X = X
4
5class Show a where show :: a -> X
6
7show' :: X
8show' = show
9
10
diff --git a/testdata/reject.ignore/typesigctx.reject.out b/testdata/reject.ignore/typesigctx.reject.out
deleted file mode 100644
index 39363080..00000000
--- a/testdata/reject.ignore/typesigctx.reject.out
+++ /dev/null
@@ -1,3 +0,0 @@
1"./tests/reject/typesigctx.lc" (line 5, column 6):
2unexpected reserved word "class"
3expecting lowercase ident, letter or digit, operator definition or uppercase ident \ No newline at end of file
diff --git a/testdata/reject.ignore/syntax01.reject.lc b/testdata/syntax01.reject.lc
index 9043a296..9043a296 100644
--- a/testdata/reject.ignore/syntax01.reject.lc
+++ b/testdata/syntax01.reject.lc
diff --git a/testdata/syntax01.reject.out b/testdata/syntax01.reject.out
new file mode 100644
index 00000000..f5cdc041
--- /dev/null
+++ b/testdata/syntax01.reject.out
@@ -0,0 +1,3 @@
1testdata/syntax01.reject.lc:3:1:
2expecting expression
3wrong indentation
diff --git a/testdata/typesigctx.reject.lc b/testdata/typesigctx.reject.lc
new file mode 100644
index 00000000..4002bb57
--- /dev/null
+++ b/testdata/typesigctx.reject.lc
@@ -0,0 +1,8 @@
1data X = X
2
3class Show' a where show' :: a -> X
4
5show'' :: X
6show'' = show'
7
8
diff --git a/testdata/typesigctx.reject.out b/testdata/typesigctx.reject.out
new file mode 100644
index 00000000..4c7aee3d
--- /dev/null
+++ b/testdata/typesigctx.reject.out
@@ -0,0 +1,25 @@
1type error: no instance of 'Show' on ???
2in builtin 'Type pattern Wildcard2
3
4------------ trace
5'X :: Type
6X :: 'X
7'XCase :: (b : 'X->Type) -> b X -> d:'X -> b d
8match'X :: (b : Type->Type) -> b 'X -> d:Type -> b d -> b d
9'Show' :: Type->Type
10show' :: {a} -> {b : 'Show' a} -> a->'X
11!type error: no instance of 'Show' on ???
12in builtin 'Type pattern Wildcard2
13
14------------ tooltips
15testdata/typesigctx.reject.lc 1:6-1:7 Type
16testdata/typesigctx.reject.lc 1:6-1:11 Type
17testdata/typesigctx.reject.lc 1:10-1:11 X
18testdata/typesigctx.reject.lc 3:7-3:12 Type->Type
19testdata/typesigctx.reject.lc 3:7-3:36 Type
20testdata/typesigctx.reject.lc 3:21-3:26 {a} -> {b : Show' a} -> a->X
21testdata/typesigctx.reject.lc 3:30-3:31 Type
22testdata/typesigctx.reject.lc 3:30-3:36 Type
23testdata/typesigctx.reject.lc 3:35-3:36 Type
24testdata/typesigctx.reject.lc 5:11-5:12 Type
25testdata/typesigctx.reject.lc 6:10-6:15 {a} -> {b : Show' a} -> a->X