]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.runtime/scl/Random.scl
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.scl.runtime / scl / Random.scl
diff --git a/bundles/org.simantics.scl.runtime/scl/Random.scl b/bundles/org.simantics.scl.runtime/scl/Random.scl
new file mode 100644 (file)
index 0000000..1c6d7ce
--- /dev/null
@@ -0,0 +1,26 @@
+effect Random 
+    "random"
+    "java.util.Random"
+
+importJava "org.simantics.scl.runtime.procedure.RandomEffect" where
+    withSeed :: Long -> (<Random,e> a) -> <e> a
+    runRandom :: <Random,e> a -> <Proc,e> a
+
+importJava "java.util.Random" where
+    @JavaName nextInt
+    randomN :: Integer -> <Random> Integer
+    
+    @JavaName nextInt
+    randomInteger :: <Random> Integer
+    
+    @JavaName nextDouble
+    randomDouble :: <Random> Double
+    
+    @JavaName nextFloat
+    randomFloat :: <Random> Float
+    
+    @JavaName nextLong
+    randomLong :: <Random> Long
+    
+    @JavaName nextBoolean
+    randomBoolean :: <Random> Boolean
\ No newline at end of file