Monads/Maybe monad: Difference between revisions

Content added Content deleted
(Rename Perl 6 -> Raku, alphabetize, minor clean-up)
m (Fix Perl 6 -> Raku in comments)
Line 953:
{{works with|Rakudo|2019.11}}
It is exceptionally difficult to come up with a compelling valuable use for
a Maybe monad in Perl 6Raku. Monads are most useful in languages that don't have
exceptions and/or only allow a single point of entry/exit from a subroutine.
 
Line 962:
 
The task description asks for two functions that take an Int and return a Maybe
Int or Maybe Str, but those distinctions are nearly meaningless in Perl 6Raku. See
below.
 
Line 976:
$monad is both an Int '''and''' a Str. It exists in a sort-of quantum state
where what-it-is depends on how-it-is-used. Bolting on some 'Monad' type to do
this will only ''remove'' functionality that Perl 6Raku already has.
 
Ok, say you have a situation where you absolutely do not want an incalculable