X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.scl.runtime%2Fscl%2FPrelude.scl;h=d5d2788285d45a30c815a303be8937dd5f60ad68;hb=d9856d2391ee17f815a43dad74d9dc6318a1878c;hp=cce9064090ca123545e387b711e7cab902e95680;hpb=cc7c007fb930bb1453a529916f8cf2ba8d18f0e3;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.scl.runtime/scl/Prelude.scl b/bundles/org.simantics.scl.runtime/scl/Prelude.scl index cce906409..d5d278828 100644 --- a/bundles/org.simantics.scl.runtime/scl/Prelude.scl +++ b/bundles/org.simantics.scl.runtime/scl/Prelude.scl @@ -48,10 +48,6 @@ type FloatArray = Vector Float type DoubleArray = Vector Double importJava "java.util.Arrays" where - @private - @JavaName toString - showDoubleArray :: DoubleArray -> String - "Converts an array to a list." @JavaName asList arrayToList :: Array a -> [a] @@ -61,9 +57,6 @@ importJava "java.util.List" where @JavaName toArray listToArray :: [a] -> Array a -instance Show DoubleArray where - show = showDoubleArray - importJava "org.simantics.scl.runtime.Coercion" where "Converts a list of doubles to a double array." toDoubleArray :: [Double] -> DoubleArray @@ -1312,6 +1305,11 @@ orElse :: Maybe a -> ( a) -> a orElse (Just x) _ = x orElse Nothing def = def +@inline +orElseM :: Maybe a -> ( Maybe a) -> Maybe a +orElseM mx@(Just x) _ = mx +orElseM Nothing def = def + /// Either /// """ @@ -2290,16 +2288,6 @@ instance Show TypeRep where isSpecialType (TApply a _) = isSpecialType a */ -// ByteArray - -importJava "java.util.Arrays" where - @private - @JavaName toString - byteArrayToString :: ByteArray -> String - -instance Show ByteArray where - show = byteArrayToString - // Type @private