1. 23
  1.  

  2. 11

    The rigour of having to separate your functions into ones that can have side effect a / b / c etc. vs the pure ones is very good training for being a more organized developer and improving your design skills. You can take a lot of the learnings from Haskell and apply them to other languages. You’ll however also notice that they’re going to be painful to stick to, because other types systems don’t support you nearly as much.

    I guess it’s somewhat analogous to going back to a language that doesn’t manage memory for you, feels odd that this huge, and most often unnecessary, burden would suddenly be placed on your shoulders again. “Why didn’t something tell me that what I wrote there a second ago made absolutely no sense?!”

    1. 3

      So…. I have been planning on learning a functional language for this reason. My choice is scheme.

      I was going Haskell than the idea that maybe go for something a little more “practicle” so I like doing things in R so I though Scala, but it is FP and OOP. Looked back at Haskell and just decided it is to big for my #1 purpose which is to change my thinking. MIT lessons on video from the 1980s and great books like Little Schemer and we I think I made the right choice.

      1. 15

        I came to Haskell from Clojure, Lisp, & Scheme. I went through SICP long before I ever learned Haskell.

        You’ll miss out on a lot if you don’t learn Haskell.

        1. 3

          So if you could jump back in time what would you tell yourself to do to save yourself time in changing your thinking? Would you skip scheme and clojure? Would you do Scheme all over again and jump to Haskell?

          1. 7

            I’d tell myself to learn PL, type theory, ML, Haskell, and category theory.

            1. 1

              Well you cost me an hour of my life :P Thanks for the info and ML looks like it actually would be a great learning experience BUT it looks like the tools for learning the language are very limited.

              Also when you say PL are you talking old school IBM language that caused me to lose my hair when I was 21 years old since we had to interface the IBM mainframe with 3 VAC and 100 mac on tolkin rings!!!!! That both leads quit the week I started working and I became the new lead! Thanks for me reviving my old ulcers!

              1. 4

                Errr, I mostly just teach people Haskell and it’s what I use for my work. You asked what I would tell my past self, not what I would tell a stranger whose interests I know nothing of. Most people have a much stronger time preference in general and particularly for self-investment.

                PL as in programming languages, theory, design, research. Most of what I’m interested in there dovetails with type theory.

                I have a guide here for learning Haskell which is hammered out by a fair bit of experience. I’m also writing a book, but that’s not going to be available for awhile.

                1. 1

                  Sorry to make this such a long conversation.

                  My Interest: Learn Functional Programming solely to learn the thought process not to pick up a new language. I mostly do data analysis with R.

                  1. 2

                    Haskell

                    1. 1

                      Although Haskell is pretty great, it’s a bit of a mountain at first. I would start with either OCaml or Erlang, both of which are a little easier to get into.

                      Erlang in particular has a tremendously and uniformly good “starter kit” in the form of learnyousomeerlang.com; working through that would get you pretty deep into the core ideas of recursion, folds, immutability, and how functional programming works in industrial practice.

                      If that’s not enough for you and you need to advance to the next level, Haskell is reachable from either of those base camps in a way that it might not be for the starter R practitioner.

                      1. 1

                        Although Haskell is pretty great, it’s a bit of a mountain at first. I would start with either OCaml or Erlang, both of which are a little easier to get into.

                        I can’t wait to show this to my coauthor whose first and only programming language is Haskell.

                        Learning OCaml and Erlang will not teach you Haskell. There’s little overlap and you won’t obtain the same benefits.

                        Haskell is learnable for FP experts, people completely new to programming (like my coauthor on our book), and everyone in between.

                        OCaml and Erlang are worth learning for their respective strengths alone. They’re not a waiting room for Haskell and learning them first won’t save you any time.

                        1. 4

                          The guy didn’t ask how to learn Haskell; if he did, I would wholeheartedly agree: he should start with Haskell. He instead asked: how to learn Functional Programming solely to learn the thought process. There are actually many significant overlaps in FP idiom between Erlang/ML-family languages and Haskell, as you well know. And, E(your coauthor) does not imply A(X) -> LearnsHaskellEasily(X). That said, really looking forward to your book and appreciate the github learning haskell repo, which I am slowly, but painstakingly, working through.

                  2. 3

                    Check out Real World OCaml for a decent intro to a modern ML descendant.

                    1. 1

                      But OCaml has Object Orient in its first letter :) I want to learn about Functional not for programming in that language but to learn to think that way.

                      1. 2

                        The name is just marketing. The OO features feel bolted on and I get the sense that hardly anyone actually uses them.

                        1. 3

                          Actually the object system in OCaml is quite interesting and is related to polymorphic variants, quite a useful and popular language feature. But it’s true that the OCaml community at large rarely uses objects and classes.

                        2. 2

                          Ignore it. Most of “Real World” OCaml is just a different syntax and slightly different features of Standard ML where ML stands for Meta Language and was used to program a theorem prover. About as functional as you can get : )

                          More pertinently, OCaml is very “functional” even in its object system which is much more a system for “row types” than an object system like you might see otherwise. Then, atop that, it’s rarely used and often seen as a design smell.

              2. 4

                Same exact story here as with @bitemyapp: came to Haskell from Clojure, and I’m currently rewriting everything we have from it. It’s THAT much of a qualitative jump if you’re planning on writing a ton of code that needs to survive the test of time and maintenance. If you’re going to be writing a few toy apps here and there, not sharing much code among them, it really doesn’t matter, do it in bash if you have to.

                Tooling like this doesn’t shine until the size of your codebase becomes serious or you need to start shipping libraries around your projects with quickly changing interfaces.

                1. 1

                  I’ve been learning Haskell coming from just finishing SICP and working a lot in Clojure, and I’d do it this way again. I feel like SICP has so much awesome to offer that I wouldn’t have learned as richly if I’d skipped it. If you’re in the Philly area, I’m leading a study group for SICP, check us out at http://www.meetup.com/Clojadelphia/

                  That being said, everyone I think should learn both a lisp and macros really well, and then something like Haskell. Just to know both sides of the force.

                  1. 1

                    Well I just live up the road in Allentown.

                    1. 1

                      Coming from the other direction, I found knowing Haskell gave me a solid foundation for formalizing a lot of the things covered in SICP. The parts on system design and abstraction building lend themselves particularly well to algebraic formalizations, even if the book shies away from using math loaded words when possible.

                  2. 2

                    The same happened to me. I still consider myself fairly new to Haskell, but since College I’ve been dealing with LISP dialects and Scheme. But thanks to Haskell, now I think about how data types and types affects a data structure and a function. I’ve learned to decompose functions based on their runtime. Now that I’m looking at Lens, I wish it was more stuff I could work on daily basis at my job. I do see how to anyone not familiar with FP can find Haskell difficult to read and write.