4 ms·
Depends what you want and what you value. Do you really need types? I did work in Clojure and I think having good support for immutable data-structures got me
by a-saleh 7y ago
Depends what you want and what you value.
Do you really need types? I did work in Clojure and I think having good support for immutable data-structures got me 80% of the benefits of functional programming.
Similarily, maybe you are sold on actors and message-passing and Erlang/Elixir is proven there :)
Or you would like types, but are not sure about the whole separation of IO from pure functions in type system, you could try Ocaml (or its Javscript-looking reskin Reasonml). Like, you don't get type-classes, but polymorphic variants are nice and there is this interesting module system.
Or, if you really want to encode your domain in types and then maybe even use the type-system to solve your programming for you, maybe try Idris? Like I have been meaning to go through 'Type-Driven Development with Idris' one day :)
But maybe Ocaml is too little and Idris is too much and Haskell sits in the nice middle ground you like :-)
- ps101 7y agoWhat's the more general pitch for learning a functional language in the first place?
- dagw 7y agoIt forces you to learn a new and different way of thinking about programming and solving software problems. Even if you never end up actually using a functional language, many of the techniques and approaches you learn can be applied in all languages. Learning Haskell was probably the single best thing I've done with regards to becoming a better programmer even I've never really written much Haskell since then
- a-saleh 7y agoI don't think there is a general one anymore. The original "wouldn't it be better if we just passed data around through simple composable functions" kinda won, you have first-class anonymous functions with support for closures in most languages today in use :-) I think the next pitch is along the lines of "We can solve the evil of mutable state making your app hard to debug/test" and i.m.o. that took over a bit as well, i.e. with frontend we usually have state in one tree sitting somewhere and what we display is just a function from state to our html. And I have seen the state being represented as a fold/reduce over events in the application. So the pitch i.m.o. is along the lines "Hey, we converged on the idea that functional programming is good, why not use language that has good support for it" :D
- dagw 7y agoAfter having dabbled a fair bit in Lisp, Haskell, Ocaml and, to a lesser extent, Elixir, I've found F# to strike a very nice middle ground when it comes to functional programming. edit: https://fsharpforfunandprofit.com/ https://fsharpforfunandprofit.com/ is a very nice introduction to F# and all the things it can do.
- a-saleh 7y agoHm, I was always kinda scared about setting up .Net on my linux box. What setup do you use?
- JCoder58 7y agoHere you go: https://fsharp.org/use/linux/ https://fsharp.org/use/linux/ Or if you just want to learn it, you can run it in your browser here: https://try.fsharp.org/ https://try.fsharp.org/