Hmmm. Seems I used the tab key instead of the space key for that one line. Looked fine in my editor and I didn't notice the difference in the post till I just looked back.
Significant whitespace can introduce some strange looking error messages (tabs are a tool of the devil).
I've tried this with Haskell, but it is so different, not just in the layout, but the entire way of structuring the program, that even the simplest of real world examples leaves me wondering where to start.
Yeah, its a real mindbending experience for a while, what with all the recursion and lack of state and partially applied functions and lazy evaluation and type inference and significant whitespace and unfamiliar syntax/precedence-rules/semantics (whew!). So I really encourage you to get a book to help you out on your new journey. (And if you get a used book and you don't like it, you can probably sell it back for about the same as you paid for it, less postage and tax)
Simple example: When should I use data, when type or newtype?
If you know C, think of "data" like "struct" and "type" like "typedef". A "newtype" is just like "data", with only one type constructor (which gets optimized away at runtime).

In reply to Re^16: World's shortest intro to function programming by Anonymous Monk
in thread Thread on Joel on software forum : "I hate Perl programmers." by techcode

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.