Which functional programming language should I learn ...

There is no built in automagical currier? Just use your own. 

The whole language is plagued with multiple argument functions and having to manually curry every single function is terribly inconvenient. Note there is no such a thing as an "auto currier" in Haskell, functions are already curried, that's how functions work. Multiple argument functions are something additional that must be programmed in the language, but it is redundant. That goes against Occam's razor as it adds a feature that is already present. (define (f a b c) ...) should just desugar to (define f (λ (a) (λ (b) (λ (c) ...)))).

I just checked on a Haskell interpreter that it is valid: 5 + 7

I don't get what you are trying to say. 5 + 7 is just a syntax sugar for (+) 5 7. This is also valid: add5 = (+ 5).

 I'm assuming you mean static typing. That is not integral to functional programming. 

No, it has nothing to do with static typing. You are confusing monads with Haskell's monad typeclass. You can just have a monad ADT.

 If you read a textbook rather than an API you will be exposed to this. Chapter 2 of SICP is entirely devoted to ADTs. One of 5 chapters.

If that is true then good. I'm yet to see Scheme code using ADTs, though. For example, let me see a piece of code using Maybe to sign a value that might or might not exist, Either to sign a value that can be two things, etc? I've never seen it, but maybe I just didn't look enough, okay?

Why is pattern matching "good functional programming" and traditional branching not?

"If" is just pattern matching for one specific type (bool). It is not "wrong" (what is "wrong" anyway) just, again, terribly inconvenient because to pattern match anything more complex you have to manually translate it to a serie of bool pattern matches. How would you represent something like:

data BinaryTree a = B (BinaryTree a) (BinaryTree a) | L a 

f :: ∀ a . Maybe (Tree a) -> a
f (Just (B (L x) (B (L y) (L z)))) = x * x + y * y + z * z
f (Just (B (B (L x) (L y)) (L z))) = x / x + y / y + z / z
f (Just (B a b)) = f a + f b
f (Just (L x)) = x
f Nothing = 0

Cleanly in Scheme?

Purity is something the programmer does.
This is totally possible as long as you write pure code in Scheme. Just avoid those !'s and you can use equational reasoning.

No, you are missing the point. On Haskell, this is valid for any expression:

((λ (x) body) y) == (body, with all occurences of x replaced by y)

In Scheme, that equation doesn't always hold. So, for example:

((lambda (a) (+ a a)) (f 0)) != (+ (f 0) (f 0)) for some `f`

That is awful - very principle of functional programming is that you are free to apply functions. That means, for one, the compiler isn't allowed to do a lot of optimizations that you can in Haskell. If you program by composing a series of maps, filters, foldrs, zips etc., you will create a ton of intermediate data structures and your program will be slow, so you're forced to rollback to loops. It also means there are a lot of guarantees the programmer can't count on. For one, I want to make sure that calling a Int -> Int function that just downloaded from a lib won't send TCP messages through the internet. There is no such guarantee in Scheme. How do I know someone didn't hide a malware inside a 3rd party lib? I can not trust foreign code without auditing it.

Now, calm down a little bit. I understand you're getting really offended with my opinions about Scheme. Please, understand that, one, I'm only pointing those problems because you asked me to elaborate, and two, this is the opinion of a random internet stranger. I don't hold the word of truth, I could be just wrong.

/r/AskProgramming Thread Parent