Monads/List monad: Difference between revisions
m
→{{header|Perl 6}}: Clarify expectations slightly
Thundergnat (talk | contribs) (→{{header|Perl 6}}: Add Perl 6 example) |
Thundergnat (talk | contribs) m (→{{header|Perl 6}}: Clarify expectations slightly) |
||
Line 338:
=={{header|Perl 6}}==
Perl 6 does not have Monad types built in but they can be emulated/implemented without a great deal of difficulty. List Monads especially are of questionable utility in Perl 6. Most item types and Listy types have a Cool role in Perl 6. (Cool being a play on the slang term "cool" as in: "That's cool with me." (That's ok with me). So Ints are pretty much treated like one item lists for operators that
In Perl 6, bind is essentially map. I'll shadow map here but again, it '''removes''' capability, not adds it. Perl 6 also provided "hyper" operators which will descend into data structures and apply an operator / function to each member of that data structure.
|