Monads/Maybe monad: Difference between revisions
Content added Content deleted
m (Added language identifier and moved a comment.) |
m (Rewrote a comment/) |
||
Line 996: | Line 996: | ||
The class has static methods, "of" and "ofNullable", which act as the unit function |
The class has static methods, "of" and "ofNullable", which act as the unit function |
||
for wrapping nullable and non-nullable values respectively. |
for wrapping nullable and non-nullable values respectively. |
||
The class instance method, "flatMap", acts as the bind function. |
The class instance method, "flatMap", acts as the bind function. |
||
<syntaxhighlight lang="java"> |
<syntaxhighlight lang="java"> |