]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/SafeDynamic1.scl
(refs #7767) SafeDynamic module
[simantics/platform.git] / tests / org.simantics.scl.compiler.tests / src / org / simantics / scl / compiler / tests / scl / SafeDynamic1.scl
diff --git a/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/SafeDynamic1.scl b/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/SafeDynamic1.scl
new file mode 100644 (file)
index 0000000..f18fd7b
--- /dev/null
@@ -0,0 +1,17 @@
+import "Prelude"
+import "SafeDynamic"
+
+a = toSafeDynamic (1 :: Double)
+b = toSafeDynamic (2 :: Integer)
+
+main = do
+    print (fromSafeDynamic a :: Maybe Double)
+    print (fromSafeDynamic a :: Maybe Integer)
+    print (fromSafeDynamic b :: Maybe Double)
+    print (fromSafeDynamic b :: Maybe Integer)
+----
+Just 1.0
+Nothing
+Nothing
+Just 2
+()
\ No newline at end of file