3 ms·
The responses you got on IRC don't necessarily represent Haskell best practice (or even good practice). Most people probably have better things to do than trans
by wyager 12y ago
The responses you got on IRC don't necessarily represent Haskell best practice (or even good practice). Most people probably have better things to do than translate random toy programs from C++.
Certain highly stateful algorithms may be difficult to translate into Haskell, in the same way that certain highly structural or lazy algorithms may be difficult to translate to C++.
I'm curious if your time complexity analyses are accurate, given that you (admittedly) did not understand the faster algorithm. You could be getting tripped up by laziness.
In general, I've found that most production Haskell code is quite fast, in both big-O and absolute terms.
- tezka 12y agoSpoken like a true Haskell fanboy. Why don't you give it a shot, OP has posted the code.
- alricb 12y agoShriram Krishnamurti to the rescue! Here's a memoized version in scheme: http://blog.racket-lang.org/2012/08/dynamic-programming-versus-memoization.html http://blog.racket-lang.org/2012/08/dynamic-programming-vers...