functional-programming

Can anyone explain Monads?

I think I understand what 'Maybe Monads' are, but I'm not sure about the other types....

How to transition to Functional Programming

It seems that the next major transition / fad will be towards Functional Programming. What resources / experiences are you finding necessary to grok functional programming?...

Learning Lisp - Why ?

I really feel that I should learn Lisp and there are plenty of good resources out there to help me do it. I'm not put off by the complicated syntax, but where in "traditional commercial programming" would I find places it would make sense to use it instead of a procedural language. Is there a commercial killer-app out there that's been...

F# curried function

Anyone have a decent example, preferably practical/useful, they could post demonstrating the concept? ...

Removing elements with Array.map in JavaScript

I would like to filter an array of items by using the map() function. Here is a code snippet: var filteredItems = items.map(function(item) { if( ...some condition... ) { return item; } }); The problem is that filtered out items still uses space in the array and I would like to completely wipe them out. Any idea? ...

F# Closure

Anyone have a decent example, preferably practical/useful, they could post demonstrating the concept? ...

Can you explain closures (as they relate to Python)?

I've been reading a lot about closures and I think I understand them, but without clouding the picture for myself and others, I was wondering if anyone can explain closures as succinctly and clearly as possible to me and others? I'm looking for a simple explanation that might help me wrap my head around why I should be using them in cer...

Useful code which uses reduce() in python

Do anyone here have any useful code which uses reduce() function of python? Is there any code other than the usual + and * that we see in the examples? Refer Fate of reduce() in Python 3000 by GvR ...

Haskell's algebraic data types

I'm trying to fully understand all of Haskell's concepts. In what ways are algebraic data types similar to generic types, e.g., in C# and Java? And how are they different? What's so algebraic about them anyway? I'm familiar with universal algebra and its rings and fields, but I only have a vague idea of how Haskell's types work. ...

Beginners Guide to Haskell?

I've been looking for a decent guide to Haskell for some time, but haven't been able to find one that seems interesting enough to read through and/or makes sense. I've had prior exposure to Haskell a few years back, but I can't remember much about it. I remember the "Aha!"-feeling was incredible when I finally got it, and it was actuall...

What's a good beginning text on functional programming?

I like to study languages outside my comfort zone, but I've had a hard time finding a place to start for functional languages. I heard a lot of good things about Structure and Interpretations of Computer Programs, but when I tried to read through it a couple of years ago it just seemed to whiz over my head. I do way better with books t...

What is the difference between procedural programming and functional programming?

I've read the Wikipedia articles for both procedural programming and functional programming, but I'm still slightly confused. Could someone boil it down to the core? ...

Functional programming and non-functional programming

In my second year of University we were "taught" Haskell, I know almost nothing about it and even less about functional programming. What is functional programming, why and/xor where would I want to use it instead of non-functional programming and am I correct in thinking that C is a non-functional programming language? Related topics ...

Is there a functional language for C++ ecosystem?

Java has Scala and .NET has F#. Both of these languages are very highly integrated into the respective Java and .NET platforms. Classes can be written in Scala then extended in Java for example. Does there exist an equivalent functional language that interoperates highly with C++? ...

Coolest C# LINQ/Lambdas trick you've ever pulled?

Saw a post about hidden features in C# but not a lot of people have written linq/lambdas example so... I wonder... What's the coolest (as in the most elegant) use of the C# LINQ and/or Lambdas/anonymous delegates you have ever saw/written? Bonus if it has went into production too! ...

Is Scala the next big thing?

I've been learning Scala recently, and it seems like a very very promising general purpose programming language. It has all the good functional programming features, terse syntax, it runs on JVM and interoperates with Java. Some think it's the Next Big Language. Others aren't so sure. Why do you think it is/isn't going to be the next b...

What is tail-recursion?

Whilst starting to learn lisp, I've come across the term tail-recursive. What does it mean? ...

What is 'Currying'?

I've seen references to curried functions in several articles and blogs but I can't find a good explanation (or at least one that makes sense!) ...

Why functional languages?

I see a lot of talk on here about functional languages and stuff. Why would you use one over a "traditional" language? What do they do better? What are they worse at? What's the ideal functional programming application? ...

What is a 'Closure'?

I asked a question about Currying and closures where mentioned. What is a closure? How does it relate to currying? Additional: Kyle's answer is great but to my poor procedural/OO mind Ben Childs answer is really useful. ...