]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.compiler/tests/org/simantics/scl/compiler/tests/scl/MissingEffect.scl
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.scl.compiler / tests / org / simantics / scl / compiler / tests / scl / MissingEffect.scl
diff --git a/bundles/org.simantics.scl.compiler/tests/org/simantics/scl/compiler/tests/scl/MissingEffect.scl b/bundles/org.simantics.scl.compiler/tests/org/simantics/scl/compiler/tests/scl/MissingEffect.scl
new file mode 100644 (file)
index 0000000..9a5ea98
--- /dev/null
@@ -0,0 +1,15 @@
+import "Prelude" hiding (findFirst)\r
+\r
+findFirst :: (a -> <e> Maybe b) -> [a] -> Maybe b\r
+findFirst f l = loop 0\r
+  where\r
+    len = length l\r
+    loop i                         \r
+        | i >= len  = Nothing\r
+        | otherwise = match f (l!i) with\r
+                        s @ (Just _) -> s\r
+                        Nothing      -> loop (i+1)\r
+\r
+main = "Not to be executed"\r
+--\r
+9:29-9:36: Side-effect a is forbidden here.
\ No newline at end of file