X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.scl.runtime%2Fscl%2FPrelude.scl;h=80b4d0ad794d8eca76d5210c5783fca6cba9a933;hp=03eabb66fb8ecd2ff7218fa5191db648350ee280;hb=5b3cb26acc141f8ec129ccc8bd087ced2f5b9dbb;hpb=77e4291d372e7b4b40ee868ad61cc07c51de8c6b diff --git a/bundles/org.simantics.scl.runtime/scl/Prelude.scl b/bundles/org.simantics.scl.runtime/scl/Prelude.scl index 03eabb66f..80b4d0ad7 100644 --- a/bundles/org.simantics.scl.runtime/scl/Prelude.scl +++ b/bundles/org.simantics.scl.runtime/scl/Prelude.scl @@ -1292,6 +1292,7 @@ fromMaybe default maybeValue = match maybeValue with _ -> default "`maybe def f v` returns `def` if `v=Nothing` and `f x` if `v=Just x`." +@inline maybe :: b -> (a -> b) -> Maybe a -> b maybe n _ Nothing = n maybe _ f (Just x) = f x