From: Hannu Niemistö Date: Wed, 7 Feb 2018 12:20:34 +0000 (+0200) Subject: (refs #7751) Added orElseM X-Git-Tag: v1.43.0~136^2~600^2 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F29%2F1429%2F1;p=simantics%2Fplatform.git (refs #7751) Added orElseM Change-Id: I365c89a1d4ad60b1763854b6d6cd0a3a94e1ab49 --- diff --git a/bundles/org.simantics.scl.runtime/scl/Prelude.scl b/bundles/org.simantics.scl.runtime/scl/Prelude.scl index 7e558bdc4..2be6ed745 100644 --- a/bundles/org.simantics.scl.runtime/scl/Prelude.scl +++ b/bundles/org.simantics.scl.runtime/scl/Prelude.scl @@ -1305,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 /// """