Hacker News new | past | comments | ask | show | jobs | submit login

> Hot take: no it isn't.

Odd. I did some Haskell in prodution (hardware control and Unix daemons) and it was delightful.

> It is extremely hard to learn, has an extremely confusing + needlessly complicated syntax and I question the payoff immensely.

It is unfamiliar if you have only worked in the C family of languages. The syntax is quite similar to the rest of the ML family, which dates back to 1973. It's basically as old as C. I had the good fortunate of learning Standard ML around the same time as C, SQL, and Perl. Standard ML and SQL were by far the most straightforward to learn.

> If I stood up in a corporate business boardroom meeting for tech analysis on a new project and said "I want to write it in Haskell", I'd get laughed + kicked out.

Yes, you would, because why are you talking about programming languages in a boardroom? If you mean a more technical review committee, I wouldn't be so sure of that.

> The syntax is quite similar to the rest of the ML family, which dates back to 1973.

How close is it to say something Like F# then? I've toyed with F# a bit and was able to pick it up pretty decently, but a lot of Haskell still looks foreign to me

If you know F# you are going to feel a lot more comfortable than coming from say C/C++/C#.

The largest difference imo between F#/Ocaml and Haskell is the evaluation model where Haskell is lazy by default.

IMHO the largest difference is purity.

Not being able to mix IO and non-IO functions like this

    print “Enter name:”
    print (“Hello “ ++ readStdinLine ++ “!”)
in Haskell means you have to learn a new way of writing IO code.

Not really. You can mix them in Haskell too. Think of F# as Haskell except you are always working in the IO monad. Haskell doesn't require a "new way of writing IO code" at all. It just allows you to separate out the IO from the pure in a way that can be enforced by the compiler. But there is nothing preventing you from writing all Haskell code in the IO monad if you were so inclined - which is essentially OCaml/F#.

> Not really. You can mix them in Haskell too.

True, but it's not particularly syntactically convenient.

The entire point of monadic (do) syntax in Haskell is to make this convenient. I'm not following you exactly.

runeks mentioned

    print “Enter name:”
    print (“Hello “ ++ readStdinLine ++ “!”)
which can't be written like that with do notation. It's also pretty confusing code to write in any language, so maybe that's not a problem.

True, do notation does require you to add a line -

  main = do
      print "Enter name:"
      name <- getLine
      print ("Hello " ++ name ++ "!")
But I only said that it makes this convenient not that it allowed you to write any statement you want. It still makes it easy to intersperse pure and non-pure code.

The surface similarities between haskell and F# are fairly clear - emphasis on pure functions, no parens and commas for function calls, etc.

Alexis King wrote an interesting comment on one reason haskell can be difficult to pick up, which might be one cause of the foreignness you've noticed: https://www.reddit.com/r/haskell/comments/ddsvbk/you_are_alr...

Really close. :: between variable name and type instead of : and similarly superficial things. As the sibling comment pointed out, the semantics can take some time to wrap your brain around.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact