X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=tests%2Forg.simantics.scl.compiler.tests%2Fsrc%2Forg%2Fsimantics%2Fscl%2Fcompiler%2Ftests%2Fscl%2FMissingEffect.scl;h=5adaf16f7244f582f327d4c830589b007f6dea7f;hb=cde82ba81327d5515fdca362f7f4c70f5103ae80;hp=9a5ea98c4d4fa540abd5cad6e193c46b4ca3b1ce;hpb=e67e00d01d30f362e7a4f599cbcf24770ce13e22;p=simantics%2Fplatform.git diff --git a/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/MissingEffect.scl b/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/MissingEffect.scl index 9a5ea98c4..5adaf16f7 100644 --- a/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/MissingEffect.scl +++ b/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/MissingEffect.scl @@ -1,15 +1,15 @@ -import "Prelude" hiding (findFirst) - -findFirst :: (a -> Maybe b) -> [a] -> Maybe b -findFirst f l = loop 0 - where - len = length l - loop i - | i >= len = Nothing - | otherwise = match f (l!i) with - s @ (Just _) -> s - Nothing -> loop (i+1) - -main = "Not to be executed" --- +import "Prelude" hiding (findFirst) + +findFirst :: (a -> Maybe b) -> [a] -> Maybe b +findFirst f l = loop 0 + where + len = length l + loop i + | i >= len = Nothing + | otherwise = match f (l!i) with + s @ (Just _) -> s + Nothing -> loop (i+1) + +main = "Not to be executed" +-- 9:29-9:36: Side-effect a is forbidden here. \ No newline at end of file