]> gerrit.simantics Code Review - simantics/platform.git/blob - tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/MissingEffect.scl
Merge commit 'bf75fd9'
[simantics/platform.git] / tests / org.simantics.scl.compiler.tests / src / org / simantics / scl / compiler / tests / scl / MissingEffect.scl
1 import "Prelude" hiding (findFirst)\r
2 \r
3 findFirst :: (a -> <e> Maybe b) -> [a] -> Maybe b\r
4 findFirst f l = loop 0\r
5   where\r
6     len = length l\r
7     loop i                         \r
8         | i >= len  = Nothing\r
9         | otherwise = match f (l!i) with\r
10                         s @ (Just _) -> s\r
11                         Nothing      -> loop (i+1)\r
12 \r
13 main = "Not to be executed"\r
14 --\r
15 9:29-9:36: Side-effect a is forbidden here.