[Haskell-cafe] Looking for suggestions to improve my algorithm