Functional programming is a paradigm which attempts to solve computational problems by the chained evaluation of functions whose output is determined by their inputs rather than the programme state. In this style of programming, side effects and mutable data are deprecated and usually strictly ...

learn more… | top users | synonyms (1)

20
votes
3answers
2k views

Do all functional languages use garbage collection?

Is there a functional language which allows to use stack semantics - automatic deterministic destruction at the end of the scope?
6
votes
3answers
358 views

choosing a functional language platform for a new project [closed]

I have been writing code for a few years now and I don't believe I can claim to have a complete knowledge in this job yet. My experience primarily rolls around C# related areas with a decent ...
12
votes
3answers
1k views

Functional Programming For Embedded Software

I was discussing F# and Functional Programming with a friend last night and he brought up an interesting question to me. How would you do embedded software in functional? I mean this seems like a ...
8
votes
5answers
645 views

Change my way of thinking in preparation for functional programming

When switching to a functional style of programming after coming from procedural and OOP, what things do I need to know upfront about "this new way of thinking"? How do you prepare yourself for ...
8
votes
11answers
2k views

Is Object Oriented stuff really that important? [closed]

For years, I have been doing Algorithmic stuff, writing scalable data structures for internet search, for example Randomized Binary Search Trees for Auto Recommendation, BitMaps, Wisdom of Crowd based ...
3
votes
2answers
184 views

In Functional Programming, should domain-relevant simple functions (e.g., sorts) be reified?

In a functional application, should you wrap common higher-level functions in domain-meaningful names or should you leave them "bare"? For instance, if you have a list of Addresses, and "sorted by ...
4
votes
1answer
515 views

PHP Aspect Oriented Design

This is a continuation of this Code Review question. What was taken away from that post, and other aspect oriented design is it is hard to debug. To counter that, I implemented the ability to turn ...
11
votes
4answers
619 views

Why are cons lists associated with functional programming?

I have noticed that most functional languages employ a singly-linked list (a "cons" list) as their most fundamental list types. Examples include CLisp, Haskell and F#. This is different to mainstream ...
8
votes
3answers
3k views

Functional Programming approach for a simplified game using Scala and LWJGL

I, a Java imperative programmer, would like to understand how to generate a simple version of Space Invaders based on Functional Programming design principles (in particular Referential Transparency). ...
26
votes
5answers
4k views

What is the difference between a function and a lambda?

I'm a little bit confused about 'function' and 'lambda'. I've seen some examples showing that the scheme keyword lambda works very similarly to the JavaScript keyword function, but I really don't ...
1
vote
2answers
188 views

Need help with deciding elements for icon creating application

I'm trying to practice programing by creating a simple application which, I think, I can manage to do in .Net C# in VisualStudio 2010. I'm working on simple application which will let me to create ...
5
votes
8answers
415 views

One-use variables - has any language ever had them?

A principle that I follow is that, when an identifier is established, it should be a signal to the reader that the value referred to is indeed an abstraction which will be used more than once. That ...
22
votes
10answers
2k views

How would Functional Programming proponents answer this statement in Code Complete?

On page 839 of the second edition, Steve McConnell is discussing all the ways that programmers can "conquer complexity" in big programs. His tips culminate with this statement: "Object-oriented ...
5
votes
2answers
290 views

Immutable design with an ORM: How are sessions managed?

If I were to make a site with a mutable language like C# and use NHibernate, I would normally approach sessions with the idea of making them as create only when needed and dispose at request end. ...
3
votes
2answers
518 views

Functional Programming: Are Tuples a viable replacement for Types?

A while ago I decided to learn Haskell to help with learning more "pure functional" ideas that I could apply to F#. Right off the bat it seems as if there's no real types in Haskell like the ones ...
4
votes
3answers
946 views

Are there any “enterprise ready” functional programming languages? [closed]

By "enterprise ready" I am referring to availability of tools: dependency management, build management, message servers, databases, application platforms and servers, and are secure and scale well? ...
5
votes
3answers
588 views

Is the COCOMO model a good argument when defending a programming language choice?

Currently, I'm following a course on embedded software development. The lecturer has chosen J as an architecture language for model-driven software development. J itself is a very terse programming ...
12
votes
5answers
2k views

Is Javascript a Functional Programming Language

Is Javascript a functional language? I know it has objects & you can do OOP with it also, but is it also a functional language, can it be used in that way? You know how OOP became/seems like the ...
3
votes
1answer
1k views

Non-OOP languages advantages and good uses

I'm a C# developer, but I also know Java, JavaScript, XSLT, a little of C and Perl, e some other that I may have forgotten. Still, the paradigm I'm most familiar to is OOP. I have always thought ...
3
votes
2answers
379 views

Functional Low-Level language that can use a webkit view

TL;DR: I need to develop an app which should look kind of the same on desktop and as a website incarnation. Since I am a web dev and have never developed for desktop, I want to use a language that ...
20
votes
1answer
2k views

How to organize functional programs [duplicate]

Possible Duplicate: Functional Programming vs. OOP How to write manageable code with functional programming? In OOP, your basic unit of organization for code is the class. A frequently ...
31
votes
18answers
6k views

What would you do if your client required you not to use object-oriented programming?

I am writing a program to simulate the activity of ants in a grid (PDF). The ant can move around, pick up things and drop things. The problem is while the action of the ants and the positions of each ...
10
votes
3answers
1k views

How to write manageable code with functional programming?

I just started with functional programming (with JavaScript and Node.js) and from the look of things it looks as if the code I am writing would grow to be one hell of a code base to manage, when ...
13
votes
4answers
862 views

Unit testing statically typed functional code

I wanted to ask you people, in which cases it makes sense to unit test statically typed functional code, as written in haskell, scala, ocaml, nemerle, f# or haXe (the last is what I am really ...
3
votes
2answers
343 views

Is it possible to develop a functional language based on PHP opcode?

Is it possible to develop a functional language based on PHP opcode? Similar to Scala/bytecode or F#/CIL Has somebody done this already?
7
votes
4answers
1k views

A programming language that does not allow IO. Haskell is not a pure language

Are there any 100% pure languages (as I describe in the Stack Overflow post) out there already and if so, could they feasibly be used to actually do stuff? i.e. do they have an implementation? I'm not ...
12
votes
5answers
1k views

What are functional-programming ways of implementing Conway's Game of Life

I recently implemented for fun Conway's Game of Life in Javascript (actually coffeescript but same thing). Since javascript can be used as a functional language I was trying to stay to that end of ...
25
votes
7answers
1k views

Should one comment differently in functional languages?

I'm just getting started with functional programming and I'm wondering about the correct way to comment my code. It seems a little redundant to comment a short function as the names and signature ...
6
votes
2answers
319 views

Values, types, kinds, and…?

We all know what a value is. A type is the type of a value. A kind is (loosely) the type of a type. A type constructs a value; a kind constructs a type. So what is the type of a kind, a thing that ...
4
votes
3answers
1k views

Most “native”/integrated functional language for Mac OS X development?

If one views the CLR/.NET runtime and associated libraries as the future of windows, then the F# programming language could be seen in that light as the most native functional language. Meaning that ...
12
votes
3answers
2k views

What are combinators and how are they applied to programming projects? (practical explanation)

What are combinators? I'm looking for: a practical explanation examples of how they are used examples of how combinators improve the quality/generality of code I'm not looking for: explanations ...
9
votes
4answers
4k views

Example of where Functional Programming is Superior to Imperative or Object-Oriented Programming? [duplicate]

Possible Duplicate: Which problems domains are more suited to functional programming solutions I've been reading about functional programming. I've been using mostly C#.net recently, and ...
12
votes
4answers
6k views

Which functional language is good for a beginner? [duplicate]

Possible Duplicate: Choosing a functional programming language I am a C++ programmer looking to learn a functional language as a hobby and out of sheer curiosity. I am not looking to be an ...
41
votes
5answers
3k views

what is the purpose of arrows?

I am learning functionnal programming with Haskell, and I try to grab concepts by first understanding why do I need them. I would like to know the goal of arrows in functional programming languages. ...
4
votes
1answer
823 views

Which problems domains are more suited to functional programming solutions

Which problems domains are more suited to functional programming solutions and why? Can anyone provide any examples? EDIT Just to clarify, I'm not asking for a list of problems. I want to know what ...
5
votes
3answers
739 views

How can I translate ML code to F#?

Recently I found a book, Purely Functional Data Structures and all the examples in this book are given in ML with Haskell versions in its appendix. But I only know one programming language with the ...
3
votes
2answers
455 views

Why isn't functional programming embraced more widely? [duplicate]

Possible Duplicate: Why isn't functional programming more popular in the industry? Does it catch on now? I've been working as a J2EE developer for the past 3 years and wanted to learn ...
5
votes
2answers
642 views

Functional programming: Writing a small interpreter

I'm working on a small Unix shell, and am contemplating the idea of writing a script interpreter. While reading about the subject I inevitably hear of functional programming, lambda calculus, and find ...
13
votes
5answers
510 views

How should someone used to FP thinking read imperative code?

I graduated from university about five months ago, and have been working in a local startup for past four months. While at university, I studied Haskell, F# etc on my own. We were taught Java at the ...
7
votes
3answers
552 views

Long parameter list versus long state variable list

In a C++ book, the author says we no longer need a function with a long parameter list because most of the parameters can be refactored into state variables in a class. On the other hand, a ...
9
votes
4answers
399 views

STDOUT and its impurity

I've read a lot of books and articles about functional programming and still ashamed of not being able to understand for sure some very basic concepts. One of the main ideas of functional programming ...
13
votes
11answers
1k views

What should I understand before I try to understand functional programming?

I've been Learning Me A Haskell For Great Good because I thought it looked interesting. Of course, I'm completely sold on the idea that functional programming will end world hunger, bring about world ...
21
votes
3answers
2k views

What is the origin and meaning of the phrase “Lambda the ultimate?”

I've been messing around with functional programming languages for a few years, and I keep encountering this phrase. For example, it is a chapter of "The Little Schemer, which certainly predates the ...
7
votes
1answer
263 views

Are there any academic papers on the merits of imperative over functional programming?

There are lots of academic papers on the merits of functional programming floating around. There's also a lot of debate that I see (on the internet) going on about the relative merits of imperative ...
22
votes
3answers
1k views

Why do some functional languages need software transactional memory?

Functional languages, by definition, should not maintain state variables. Why, then, do Haskell, Clojure, and others provide software transactional memory (STM) implementations? Is there a conflict ...
17
votes
3answers
1k views

Is return-type-(only)-polymorphism in Haskell a good thing?

One thing that I've never quite come to terms with in Haskell is how you can have polymorphic constants and functions whose return type cannot be determined by their input type, like class Foo a ...
14
votes
5answers
2k views

What is the most compatible, widely used production language to export knowledge and skills gained from Haskell?

I like Haskell, plain and simple. While Haskell is used in production software, it's not especially widely deployed from what I've seen. What is the most similar and still widely used language in ...
16
votes
4answers
2k views

why are all the functional programming tutorials so mathy?

I've been trying to learn functional programming and most tutorials I have found use math as examples for the more complicated constructs (even the simple ones in some cases). Why is this? I would ...
2
votes
1answer
1k views

Is functional decomposition really an antipattern?

While I was reading The worst anti-patterns you have came across, I clicked on the link in this post to land on the web site about anti-patterns. And the ...
16
votes
3answers
1k views

How is dependency inversion related to higher order functions?

Today I've just seen this article which described the relevance of SOLID principle in F# development- F# and Design principles – SOLID And while addressing the last one - "Dependency inversion ...