Hacker News new | ask | show | jobs
by platz 4707 days ago
Sure, a lot of those languages (Ruby, C#, Lua) borrow some FP ideas, but I think sprinkling in some FP ideas is different from F#, OCaml, and Scala where FP seems to be more "font-and-center".
1 comments

My litmus test for whether a language really succesfully marries OO and FP is: how well does a language blend pattern matching syntax and inheritance?

OCaml - basically only gives you pattern matching on primitive types. Object types end up having dramatically different code style

Scala - any syntax that deals with types quickly becomes so complicated that you can't explain it to non-experts

I don't know much about F#.

I've heard that Clojure's core.match grants pattern matching over abstract interfaces in a nice style. It's not an official part of the language, yet, though.

What is complex about Scala's pattern matching? x matches the value x, x:A matches instances of A, A(x) matches if A.unapply(x) evaluates to a Some, and _ matches anything. Erasure throws a wrench into it, but otherwise it's pretty straightforward.
This is a nice point to think about, thanks - I'll have to do some noodling on this.