X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.scl.compiler%2Ftests%2Forg%2Fsimantics%2Fscl%2Fcompiler%2Ftests%2Fscl%2FSerialization.scl;fp=bundles%2Forg.simantics.scl.compiler%2Ftests%2Forg%2Fsimantics%2Fscl%2Fcompiler%2Ftests%2Fscl%2FSerialization.scl;h=e0d44e35755b8fd54e5f9f1ee73e64e052013073;hb=969bd23cab98a79ca9101af33334000879fb60c5;hp=0000000000000000000000000000000000000000;hpb=866dba5cd5a3929bbeae85991796acb212338a08;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.scl.compiler/tests/org/simantics/scl/compiler/tests/scl/Serialization.scl b/bundles/org.simantics.scl.compiler/tests/org/simantics/scl/compiler/tests/scl/Serialization.scl new file mode 100644 index 000000000..e0d44e357 --- /dev/null +++ b/bundles/org.simantics.scl.compiler/tests/org/simantics/scl/compiler/tests/scl/Serialization.scl @@ -0,0 +1,14 @@ +import "Prelude" + +rt :: Serializable a => a -> a +rt v = deserialize (serialize v) + +main :: String +main = show ( + (rt "Hello", rt ()), + (rt 1.2 :: Double, rt 1.2 :: Float, 3 :: Integer, 4 :: Long), + rt (Just (1 :: Integer)), + (rt [1::Integer,2,3], rt [[1::Integer,2],[3,4]], fromDoubleArray (rt (toDoubleArray [3::Double,2,1]))) + ) +-- +(("Hello", ()), (1.2, 1.2, 3, 4), Just 1, ([1, 2, 3], [[1, 2], [3, 4]], [3.0, 2.0, 1.0])) \ No newline at end of file