Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

comment on

( [id://3333] : superdoc . print w/replies, xml ) Need Help??
A couple of years ago I tried writing a monad tutorial in Perl. It went pretty well for a while, and I think I was able to explain what was interesting about them and how they might be useful. But the syntax was totally abominable. You couldn't actually use it.

Even in Haskell, the syntax is pretty bad, but is saved by two things. First, Haskell's notation for constructing and composing functions is more terse than Perl's. And second, Haskell has special syntactic sugar (the "do" notation) for expressing monadic computations.

Anyway, I think it would be worth doing, if it could be expressed readably, but I was not able to figure out a way to do that.

This is the best explanation of monads that I have ever read. I hope you enjoy it.

In reply to Re: Is it worth using Monads in Perl ? and what the Monads are ? by Dominus
in thread Is it worth using Monads in Perl ? and what the Monads are ? by rootcho

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.