4 ms·
I think part of the issue that the parent comment was trying to get at here, is that haskell does things the way it does for a reason, and that the type system
by axlprose 9y ago
I think part of the issue that the parent comment was trying to get at here, is that haskell does things the way it does for a reason, and that the type system is much more of an aid to thinking about the problem you're solving than some restrictive handcuff, once you understand what it's doing and why it's doing it. I say this as someone who worked in F# for years, and eventually switched to haskell because it had better support for these concepts via it's built-in typeclasses.
As for what you say about haskell being "monad acrobatics", it can be equally true of F#, or any other typed functional language, because all monads/applicatives/functors/etc are, are just helpful functional design patterns. It would be like calling Factories in Java handcuffs. If you don't want to code using Factories or Monads in Java/Haskell, that's still your choice, but if a lot of libraries in that language are using that pattern, it's probably for a reason that makes it useful in that language's paradigm. Haskell just makes it easier to use these patterns than F#/OCaml/Elm/etc because of its typeclasses, so a lot more people use them. That's all there is to it. I'll grant you that F#'s tooling is a little bit better in places though, but I was never a huge fan of it's project/module system. OCaml probably has both F# and Haskell beat there.
That being said, F# is still a fine language, and I think it's probably a better stepping stone towards learning haskell (and typed functional programming in general) than haskell itself, just because it gives you the option of gradually easing your way into the ML style of programming if you've already had some imperative programming experience before. And that's key, because the issue here is one of shifting the way you think about your programming problems, and there's simply no quick/easy way to do that. In fact, I find that a lot a complete newcomers to programming have an easier time learning how to do things the haskell way, because they don't really have these issues of feeling restricted by the type system, since it's the only way they've been taught to do things.
So overall I would say just keep at it with F#, and check out the F# way of doing things like monads (or "computation expressions" [0] as they're called in F#) , monoids [1], "Railway Oriented Programming" [2], and other such patterns [3], then maybe try checking out Haskell again later and see if it seems a little easier. But there's really no reason to be bashing it regardless.
[0] https://fsharpforfunandprofit.com/series/computation-expressions.html https://fsharpforfunandprofit.com/series/computation-express...
[1] https://fsharpforfunandprofit.com/posts/monoids-without-tears/ https://fsharpforfunandprofit.com/posts/monoids-without-tear...
[2] https://fsharpforfunandprofit.com/rop/ https://fsharpforfunandprofit.com/rop/
[3] https://fsharpforfunandprofit.com/series/map-and-bind-and-apply-oh-my.html https://fsharpforfunandprofit.com/series/map-and-bind-and-ap...