Haskell is beautiful in practice
monkey.org
monkey.org
Haskell is cool, but it's one of those languages I'm going to have to accept that I'm not smart enough to program in.
p_term :: Parser Term
p_term = t <* spaces
where
t = IntTerm <$> p_num (readSigned readDec)
<|> FloatTerm <$> p_num (readSigned readFloat)
<|> AtomTerm <$> p_atom
<|> TupleTerm <$> p_tuple
<|> BytelistTerm . C.pack <$> p_string
<|> ListTerm <$> p_list
<|> BinaryTerm . B.pack <$> p_binary
"Again, reading very naturally"Here, the <|> and <$> and <* are unfamiliar and weird-looking: fair enough. But once you know that <|> means "or", and <$> means "try to parse some of the input using the thing on the right, and then the thing on the left is the resulting value", and <* means "try to parse both of these, and return the result of parsing the first one", it's hard to see how it could be much simpler.
Only <* is a really new construction.
($) isn't any kind of strictness operator -- maybe you're thinking of ($!). ($) is a plain old function application operator.
What did Gandhi say...
There are examples of Haskell being needlessly hard to read - I'm not a fan of having optional significant whitespace in only some parts of the language, for example - but this isn't a great example.
Parsec is a special case: it's full of unusual operators, because it is really like a DSL for parsing. It is really quite beautifully designed however.
It just annoys me when people look at the language and their brain shuts down because they see a (:) or a ($).
When I was first learning Lisp I was frustrated by the syntax for characters; #\a means the letter a, or 'a' in C, both are three key strokes, and I didn't understand the unusual convention. Well, it's because Lisp allows named characters, like #\Tab and #\Newline, along with custom unicode characters like #\Arabic_Alif. Aha!
Unix-syntax is almost always single-purpose; that doesn't help reuse, and causes reader-table over population. Lisp, and functional-language style syntax is there for a very good reason, usually your own good.
I think it's time for us to stop calling them "programming languages" and call them something else. I suggest notation, but even "Awkdawdkawd" would be an improvement :|
That said, I gave up on Haskell. I spend a lot of time semi-learning languages because it is fun. But, for practicality, I really concentrate on knowing just Ruby, Common Lisp, and Java very well.
Striking a good balance between practicality and having fun is not so easy to do.
Ditto with Bach. On the other hand, I 'get' the beauty of Beethoven and the Boards. To each his own ... but 'beauty' is de gustibus, and mere functionality does not qualify.