1. 6

I enjoy Functional Programming, but I’m not normally evangelical about it. The other day I was asked not to use FP, so I decided to get on the soapbox for a bit.

  1.  

  2. 1

    With the exception of the first point none of these things seem to be related to functional programming, they are about haskell’s type system.

    You can find examples of functional languages that are missing these features (some lisps) and of oo languages that have them (rust).

    1. 3

      I’d consider Rust more functional than oo. The only oo thing that comes to mind off the top of my head is the syntactic ability to declare infix functions with a this argument.

      I think of functional programming, generally, as programming with an emphasis on correctness. It feels like this has changed over time to encompass many things such as first-class functions, immutability, static types, etc. Given that, I would argue that static types are core to the spirit of functional programming, though I wouldn’t fully rule out a languages that embrace that spirit in other ways (e.g. clojure). I guess you could argue that what I (and possibly the author) think of as functional programming isn’t/shouldn’t be called functional programming, but arguing semantics (outside the context of PLD ;)) is meh.

      When someone tells me that they have an interest in functional programming, I usually take that to mean a little more than they really like programming with first-class functions.

      1. 3

        It’s amazing how we can all have different answers to this! For example, I would never call a language without guaranteed tail call elimination functional, because it places a real restriction on writing recursive functions. I would say instead that Rust has borrowed many features from traditionally functional languages. :)

        I also wouldn’t call Rust OO, fwiw, but my opinion there is weaker.

        1. 2

          I don’t really know what bucket to put rust in honestly. I was hesitant to write that above but continued anyway since it was the language that popped into my mind.

          I’d still consider this article to be more about strong static typing which necessarily isn’t a functional thing, its a strong static typing thing. To continue to beat my drum look at the various Lisps and Schemes, they aren’t statically typed, but there is no doubt that they are functional programming languages.

          1. 1

            I guess you could argue that what I (and possibly the author) think of as functional programming isn’t/shouldn’t be called functional programming,

            Agreed - that’s why I started the piece with “What I mean by Functional Programming”. It doesn’t matter what we call it - the things I put on that are what are important to me. Is there some other name for this nexus of language features?