Tagged Questions

112
votes
11answers
11k views

Is there a software-engineering methodology for functional programming?

Software Engineering as it is taught today is entirely focused on object-oriented programming and the 'natural' object-oriented view of the world. There is a detailed methodology that describes how to ...
55
votes
12answers
13k views

Medium-size Clojure sample application?

Is there a medium-sized Clojure sample application that could be used as a "best-practices" example, and a good way to see what such an application would look like in terms of code and code ...
48
votes
6answers
11k views

Generating permutations lazily

I'm looking for an algorithm to generate permutations of a set in such a way that I could make a lazy list of them in Clojure. i.e. I'd like to iterate over a list of permutations where each ...
48
votes
9answers
2k views

In pure functional languages, is there an algorithm to get the inverse function?

In pure functional languages like Haskell, is there an algorithm to get the inverse of a function, (edit) when it is bijective? And is there a specific way to program your function so it is?
45
votes
10answers
8k views

Yet another Haskell vs. Scala question [closed]

I've been using Haskell for several months, and I love it—it's gradually become my tool of choice for everything from one-off file renaming scripts to larger XML processing programs. I'm definitely ...
41
votes
7answers
14k views

Clojure vs Haskell for web applications?

I want to learn a functional language that will be good for building web applications in the future. I am choosing between Clojure and Haskell. Which one is a better choice for my purpose?
40
votes
14answers
4k views

Calculating the Moving Average of a List

This weekend I decided to try my hand at some Scala and Clojure. I'm proficient with object oriented programming, and so Scala was easy to pick up as a language, but wanted to try out functional ...
29
votes
5answers
7k views

Are there any good Clojure benchmarks?

Edit: The Clojure benchmarks are up on the Benchmarks Game. I have made this question community wiki and invite others to keep it updated. Is anyone aware of benchmarks of Clojure's performance? ...
28
votes
8answers
2k views

Clojure for a lisp illiterate

I am a lifelong object-oriented programmer. My job is primarily java development, but I have experience in a number of languages. Ruby gave me my first real taste of functional programming. I loved ...
27
votes
9answers
1k views

Functional equivalent of decorator pattern?

What is the functional programming equivalent of the decorator design pattern? For example, how would you write this particular example in a functional style?
27
votes
4answers
3k views

How can I transition from Java to Clojure?

After discovering Clojure I have spent the last few days immersed in it. What project types lend themselves to Java over Clojure, vice versa, and in combination? What are examples of programs ...
25
votes
18answers
3k views

Which language would you use for the self-study of SICP? [closed]

I've caught the bug to learn functional programming for real. So my next self-study project is to work through the Structure and Interpretation of Computer Programs. Unfortunately, I've never learned ...
23
votes
3answers
1k views

Is there a Haskell idiom for updating a nested data structure?

Let's say I have the following data model, for keeping track of the stats of baseball players, teams, and coaches: data BBTeam = BBTeam { teamname :: String, manager :: Coach, ...
22
votes
18answers
2k views

How do I get my brain moving in “lisp mode?”

My professor told us that we could choose a programming language for our next programming assignment. I've been meaning to try out a functional language, so I figured I'd try out clojure. The ...
22
votes
3answers
1k views

Clojure: How to find out the arity of function at runtime?

Given a function object or name, how can I determine its arity? Something like (arity func-name) . I hope there is a way, since arity is pretty central in Clojure

1 2 3 4 5 13
15 30 50 per page