3
votes
2answers
103 views

Optimizing unboxed array operations in Haskell

Consider this simplified code which successively permutes array elements: import Data.Word import Data.Bits import Data.Array.Unboxed import Data.Array.Base import Data.Array.ST test3 :: UArray Int ...
0
votes
0answers
98 views

Could someone profile the space and time complexity of this Haskell snippet?

I'm new to programming and even more new to Haskell, below is a little tid-bit I wrote that operates on a bunch of lists. I am wondering if someone would be kind enough to walk through the function ...
3
votes
1answer
152 views

Is there a way to avoid unnecessary recursion?

As with my other question this is regarding my Kalaha solver. Currently the way I find out the optimal progression of moves is with a command like this: snd $ head $ reverse $ sortByMostInStore $ ...
8
votes
0answers
252 views

How can I make my stack monad, (in Haskell) faster?

I made a stack monad, (in Haskell), that lets one manipulate and control values on a stack. I want to know if it's correct, (it seems correct), how to make it faster, and how I could detect stack ...
6
votes
2answers
139 views

Naive Bayes classifier

I just started learning Haskell, and I must say it is unlike anything else. As my first not-entirely-trivial piece of code I tried to write a simple Bayes Classifier. It is in two parts, a classifier ...
4
votes
1answer
242 views

Longest non-decreasing subsequence, in Haskell

OK, so I recently posted this solution in Python to the longest non-decreasing subsequence problem, and cleaned it up with some expert advice. As a next step, I wanted to translate this solution into ...
3
votes
1answer
249 views

Optimizing ByteString escaping

I wrote a string escaping function in C, and I'm trying to rewrite it to Haskell. The C version, along with comments explaining why it does what it does, can be found on GitHub. Here's a naïve ...