Skip to main content
The 2025 Developer Survey results are in. Explore insights into technology and tools, careers, community and more. View results.

All Questions

Filter by
Sorted by
Tagged with
5 votes
1 answer
207 views

Combinatoric problem in Haskell

I am new to functional programming. Just now I solved my first "real world" task using Haskell and now I'm wondering whether I got it "right" and what can be improved. The problem arises from tensor ...
nalex's user avatar
  • 53
5 votes
2 answers
709 views

Calculating the count of integer partitions of a number (uses stateful vectors internally)

I've written a Haskell function to count the number of partitions of an integer - it's basically an implementation of the same algorithm as this one, using Euler's Pentagonal Number Theorem: $$P(n) = ...
phlummox's user avatar
  • 218
3 votes
2 answers
2k views

N-queens problem in Haskell by bruteforce

I wrote a Haskell program to solve the N-queens problem by bruteforce. It works and I find it reasonably readable But it is pretty slow: 5 seconds for one solution of 8 queens. 1 minute for one ...
Caridorc's user avatar
  • 28k