From: Tuukka Lehtonen Date: Thu, 21 Jun 2018 20:19:09 +0000 (+0300) Subject: Inlined Prelude/maybe X-Git-Tag: v1.43.0~136^2~452 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=refs%2Fheads%2Fprivate%2Facorn-debug-tools;p=simantics%2Fplatform.git Inlined Prelude/maybe gitlab #31 Change-Id: I88298efc212596ad57adf468ed54b8f268050126 --- 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