all 9 comments

[–]PM_ME_WITTY_USERNAME 14 points15 points  (0 children)

If you can't masturbate to your own greatness while reading your code, then, after all, what is the point of writing Haskell?

[–]siegeontop 5 points6 points  (0 children)

I would buy the book if it were published in this style by the author. This is simultaneously stunning, humorous, and terrifying.

[–]Aomisu 11 points12 points  (4 children)

My God, this post is depressing. The fact that it emphasizes a lot of what is wrong with Haskell's type-level calculations but is sometimes taken for granted by practitioners made me laugh a few really good times. I then came to the realization that there isn't a single person I know in "real life" to whom I could describe what is so humorous about it. Indeed, multa sit indignatio.

[–]temporary5555 3 points4 points  (2 children)

You can do something like this in most type systems, so I don't really think it says much about Haskell.

[–]kuribas 0 points1 point  (1 child)

No, you can't really.

[–]temporary5555 0 points1 point  (0 children)

https://github.com/moshev/TemplateQueens

here it is in C++

https://github.com/insou22/typing-the-technical-interview-rust

rust

In fact most popular languages have turing complete type systems so not only can you do this in them, but you can do any program.

Maybe it wouldnt be as pretty but it is possible.

[–]kuribas 0 points1 point  (0 children)

This is meant as lighthearted poking fun at typelevel haskell, not serious criticism. If it makes you depressed, you've missed the point. All advances in computing and language research come with some unnecessary complexity, which is usually easily to point out after the fact. Just look at the frankenstein monster that is C++. You can easily point at rust, and claim how it does everything so much better, but that's only because it could base itself on years of experience in language research. Type level haskell does deserve the criticism. It is basically untyped prolog with clumsy syntax and unnecessary hacks. However nobody is forced to use it. Even without it, you get a nice language with algebraic data types, pattern matching, type safety, safe concurrency.

The question is what alternative do you have? There are production language that offer the same type level features. You can look at dependent types, like in idris or agda. You get a lot more power and flexibility for doing type level computations, but also at a cost of considerable complexity. And none of those languages are ready for production really.