Monads/Maybe monad: Difference between revisions

Content added Content deleted
m (→‎{{header|Python}}: Improve type hints)
m (→‎{{header|Wren}}: Minor tidy)
Line 2,067: Line 2,067:
{{trans|Go}}
{{trans|Go}}
{{libheader|Wren-fmt}}
{{libheader|Wren-fmt}}
<syntaxhighlight lang="ecmascript">import "/fmt" for Fmt
<syntaxhighlight lang="ecmascript">import "./fmt" for Fmt


class Maybe {
class Maybe {
Line 2,096: Line 2,096:
var s1 = (m1.value) ? "%(m1.value)" : "none"
var s1 = (m1.value) ? "%(m1.value)" : "none"
var s2 = (m2.value) ? "%(m2.value)" : "none"
var s2 = (m2.value) ? "%(m2.value)" : "none"
System.print("%(Fmt.s(4, s1)) -> %(s2)")
Fmt.print("$4s -> $s", s1, s2)
}</syntaxhighlight>
}</syntaxhighlight>