Closed filidorwiese closed 2 years ago
The With Maybe
example implies that Maybe is used within the whole project, so getConfig
would return a Maybe<Confg>
. It could be made more clear but the example is for demonstration purposes only.
I don't know, I'll close this issue but if anyone else is reading this and feels the same way please leave a comment, I might reconsider the examples.
Thanks for the super quick reply. I can understand getConfig()
returning a Maybe
making the Maybe.of()
superfluous. But even then the .chainNullable
addition would be more accurate. It seems unlikely to me that each property in the getConfig()
Maybe is wrapped in a Maybe itself.
Anyways, it's your call, it just confused me today. Keep up the good work :+1:
On https://gigobyte.github.io/purify/adts/Maybe/ the following example is given:
Although it's not fully clear what the hypothetical
getConfig()
method returns, the non-Maybe example suggests that it is probably a plain object with an optionalport
property:Should the Maybe-equivalent example then not be:
instead?