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