]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.scl.runtime/scl/Random.scl
Fixed multiple issues causing dangling references to discarded queries
[simantics/platform.git] / bundles / org.simantics.scl.runtime / scl / Random.scl
1 effect Random 
2     "random"
3     "java.util.Random"
4
5 importJava "org.simantics.scl.runtime.procedure.RandomEffect" where
6     withSeed :: Long -> (<Random,e> a) -> <e> a
7     runRandom :: <Random,e> a -> <Proc,e> a
8
9 importJava "java.util.Random" where
10     @JavaName nextInt
11     randomN :: Integer -> <Random> Integer
12     
13     @JavaName nextInt
14     randomInteger :: <Random> Integer
15     
16     @JavaName nextDouble
17     randomDouble :: <Random> Double
18     
19     @JavaName nextFloat
20     randomFloat :: <Random> Float
21     
22     @JavaName nextLong
23     randomLong :: <Random> Long
24     
25     @JavaName nextBoolean
26     randomBoolean :: <Random> Boolean