X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=tests%2Forg.simantics.scl.compiler.tests%2Fsrc%2Forg%2Fsimantics%2Fscl%2Fcompiler%2Ftests%2Fscl%2FFoldlBuild1.scl;h=ab1c72de2094adc0e6bb9d388d583948e1f58ef1;hp=21dfdea64a40f0af8c126c208be202c9332486a6;hb=172abed5dbf73c1304a7a95bb8504ea293556948;hpb=f8576d4d2b3b30d76db552d624fc9f087b8940bd diff --git a/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/FoldlBuild1.scl b/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/FoldlBuild1.scl index 21dfdea64..ab1c72de2 100644 --- a/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/FoldlBuild1.scl +++ b/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/FoldlBuild1.scl @@ -1,18 +1,18 @@ -import "Prelude" - -inc :: Ref Integer -> Integer -inc r = do - v = getRef r - newV = v+1 - r := newV - newV - -main = do - r = ref 0 - // Because both map and for get side-effectful functions - // as parameters, the fusion is not allowed. - l = map (\_ -> inc r) [1..4] - for l (\i -> r := i+1) - getRef r --- -5 +import "Prelude" + +inc :: Ref Integer -> Integer +inc r = do + v = getRef r + newV = v+1 + r := newV + newV + +main = do + r = ref 0 + // Because both map and for get side-effectful functions + // as parameters, the fusion is not allowed. + l = map (\_ -> inc r) [1..4] + for l (\i -> r := i+1) + getRef r +-- +5