Getting started with Haskell

This question’s answers are a community effort. Edit existing answers to improve this post. It is not currently accepting new answers or interactions. For a few days I’ve tried to wrap my head around the functional programming paradigm in Haskell. I’ve done this by reading tutorials and watching screencasts, but nothing really seems to stick. … Read more

Functional programming vs Object Oriented programming [closed]

Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 5 years ago. Improve this question I’ve been mainly exposed to OO programming so far and am looking forward to learning a … Read more

Monad in plain English? (For the OOP programmer with no FP background)

In terms that an OOP programmer would understand (without any functional programming background), what is a monad? What problem does it solve and what are the most common places it’s used? Update To clarify the kind of understanding I was looking for, let’s say you were converting an FP application that had monads into an … Read more

What part of Hindley-Milner do you not understand?

I swear there used to be a T-shirt for sale featuring the immortal words: What part of do you not understand? In my case, the answer would be… all of it! In particular, I often see notation like this in Haskell papers, but I have no clue what any of it means. I have no … Read more

What is the difference between a ‘closure’ and a ‘lambda’?

Could someone explain? I understand the basic concepts behind them but I often see them used interchangeably and I get confused. And now that we’re here, how do they differ from a regular function? 15 s 15 There is a lot of confusion around lambdas and closures, even in the answers to this StackOverflow question … Read more

Does functional programming replace GoF design patterns?

Since I started learning F# and OCaml last year, I’ve read a huge number of articles which insist that design patterns (especially in Java) are workarounds for the missing features in imperative languages. One article I found makes a fairly strong claim: Most people I’ve met have read the Design Patterns book by the Gang … Read more

What is (functional) reactive programming?

Locked. This question and its answers are locked because the question is off-topic but has historical significance. It is not currently accepting new answers or interactions. I’ve read the Wikipedia article on reactive programming. I’ve also read the small article on functional reactive programming. The descriptions are quite abstract. What does functional reactive programming (FRP) … Read more

Does JavaScript have a method like “range()” to generate a range within the supplied bounds?

In PHP, you can do… range(1, 3); // Array(1, 2, 3) range(“A”, “C”); // Array(“A”, “B”, “C”) That is, there is a function that lets you get a range of numbers or characters by passing the upper and lower bounds. Is there anything built-in to JavaScript natively for this? If not, how would I implement … Read more

map function for objects (instead of arrays)

I have an object: myObject = { ‘a’: 1, ‘b’: 2, ‘c’: 3 } I am looking for a native method, similar to Array.prototype.map that would be used as follows: newObject = myObject.map(function (value, label) { return value * value; }); // newObject is now { ‘a’: 1, ‘b’: 4, ‘c’: 9 } Does JavaScript … Read more