News for hackers. Stuff that matters.
Re:Why the world needs Haskell by tieTYT on Tuesday July 09, 2013 @08:26PM (#6016619)
Can you list those same features that it provides? My understanding of Scala's philosophy is it provides as many features as it can. A Maybe type, immutable state, separation of IO, etc. isn't very useful if my coworker can choose not to use it.
Re:Why the world needs Haskell by lmm on Wednesday July 10, 2013 @05:27AM (#6018331)
In theory that's true, and I hope Scala eventually makes non-null, immutability and perhaps even I/O visible at the type level. In practice as long as it's clear when you are bypassing these systems, and you have a culture of not doing so (and the language libraries are part of the same culture), you get most of the benefits.

Even in Haskell you can cast out of your type system, or unsafePerformIO, no?

Re:Why the world needs Haskell by ionforce on Tuesday July 09, 2013 @10:02PM (#6017011)
Scala is like Perl in that there is a non-zero possibility of writing non-native code. In Scala, you're supposed to favor immutability and functional constructs, but there's nothing preventing you from treating Scala exactly like Java. Same with Perl and C.

Also, if you need a language to dictate your coworker's behavior, that says something more about your coworker than the language. Why doesn't he just choose to write good code? (barring arguments regarding the activation energy of good versus bad code)

Re:Why the world needs Haskell by ericssmith on Tuesday July 09, 2013 @10:39PM (#6017130)
I assume by "non-native", you mean "non-idiomatic"?

Since I recently went through coworkers writing "bad" (by which I mean non-idiomatic) Scala, and repairing the situation, I can say that it was surprisingly easy to lay down "functional constructs" and the result was amazing. The code became reliable, well-structured, and easy to leverage. Switching to Scala for our projects -- including introducing procedurally minded programmers to it -- was a huge win for us.

Re:Why the world needs Haskell by pspeter3 on Tuesday July 09, 2013 @10:58PM (#6017189)
Yeah, we discovered that for my team's projects as well. Having a scala "guru" define and teach idiomatic scala has actually increased our productivity a lot. Any non-idiomatic scala is now purely for interacting with our existing Java libraries
Re:Why the world needs Haskell by ericssmith on Wednesday July 10, 2013 @06:47AM (#6018563)
FWIW, the constructs with the initial biggest win for us (in converting procedural thinking) were pattern matching and option types. For pattern matching, the guidelines were

- Don't do any processing after the pattern match within a function; break into smaller functions

- Reach for pattern matching before if/else

- Avoid the use of var

- Avoid dropping through to wildcard pattern. (This tip was from Yaron Minsky of OCaml fame)

In conjunction with preferring the use of combinators over loops, and using Option (and being forced to think about None), we got surprisingly functional Scala code in a short time.

Re:Why the world needs Haskell by ionforce on Wednesday July 10, 2013 @09:45AM (#6019420)
You are correct; I should have said non-idiomatic rather than non-native.

But idiomatic writers do feel like natives!

Re:Why the world needs Haskell by pkolaczk on Wednesday July 10, 2013 @05:15AM (#6018292)
Sometimes it is good to drop into non-idiomatic, imperative code for the sake of performance. This is one of the things I like Scala for - it lets you choose your poison.
Re:Why the world needs Haskell by spullara on Wednesday July 10, 2013 @12:51AM (#6017507)
Scala cannot choose it if you code review. If you don't code review, you are probably in a mixed quantum state anyway, regardless of the language.
Re:Why the world needs Haskell by tome on Wednesday July 10, 2013 @04:56AM (#6018219)
But that's the point. Not in Haskell! (Or almost not :)

Haskell goes out of its way to make it hard to do "dangerous" things by accident.