]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/ListSyntax8.scl
Automatic execution of SCL tests in Maven
[simantics/platform.git] / tests / org.simantics.scl.compiler.tests / src / org / simantics / scl / compiler / tests / scl / ListSyntax8.scl
diff --git a/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/ListSyntax8.scl b/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/ListSyntax8.scl
new file mode 100644 (file)
index 0000000..ac5ce57
--- /dev/null
@@ -0,0 +1,12 @@
+import "Prelude"\r
+\r
+a :: [Either Integer Integer]\r
+a = [Left 1, Right 2, Left 3, Right 4]\r
+\r
+lefts :: [Either a b] -> [a]\r
+lefts l = [x | Left x <- l] \r
+\r
+main :: [Integer]\r
+main = lefts a\r
+--\r
+[1, 3]
\ No newline at end of file