News for hackers. Stuff that matters.
Re:Popularizing Haskell through easy web deployment by tel on Saturday December 07, 2013 @08:38AM (#6866332)
Oh yes! My favorite part of Haskell's type system is it's documentation purpose. It doesn't cover intent very well, but it's quite frequent that I can reason about the entire purpose and functionality of a function just by looking at its type. This documentation is guaranteed to never go out of date.
Re:Popularizing Haskell through easy web deployment by miloshadzic on Saturday December 07, 2013 @09:17AM (#6866408)
I feel that while type information is useful, some of the more advanced libraries have signatures that are very difficult to reason about.

Disclaimer: Didn't write read a lot of Haskell so it may be just that.

Re:Popularizing Haskell through easy web deployment by tel on Saturday December 07, 2013 @09:53AM (#6866483)
Definitely. It can go VERY overboard at times, and that's part of Haskell style, writing code that makes intelligible types appear. It means that both the compiler and your users will have an easy time with your code. Most of the best libraries are pretty good about that.

It's also a familiarity thing. The most complex signatures require some practice before they're easy to digest.

Re:Popularizing Haskell through easy web deployment by kazagistar on Sunday December 08, 2013 @06:29AM (#6869505)
See, the issue I have with this is that in my own experiences with other language, this is almost never a problem. I don't need to know "what" something is doing, I need to know "why" the developer did it that way. Haskell seems like it goes out of its way to obfuscate intent with heavy abstraction, avoidance of semantic variable names, and sometimes avoidance of variable names entirely. That seems like exactly the sort of code that I find least comprehensible...
Re:Popularizing Haskell through easy web deployment by tel on Sunday December 08, 2013 @07:05PM (#6872148)
By "what" I mean semantically what---I need to know that this function turns a Tree into a List or a Person into a String. I find this information very useful as it's fairly non-operational. Usually functions are further documented with a bit of intent information.

The avoidance of variable names is hard to judge until you program in Haskell a lot. Variables (or "points") tend to just be used to wire pipes together. These variables are rarely used more than a line or two after their definition and thus short names emphasize this local context.

When people write code that involves variables naming mutable cells or long-lived context they provide long, descriptive names. I don't think anyone disagrees about the utility of that. It's just a rare style in Haskell.