i think i'm beyond the point of no return when i get frustrated with other langs to implement an algorithm. its just oo easy in haskell, even with my noobness.
i've got a basic huffman codec and want to improve the haskellness of it. can you guys take a look?
lines 49+ are me just making some test data to play with
some thing i'm wondering about:
- i'm declaring Ord a => .... all over the place, is there a way to factor it out of let the compiler derive it?
- lines 17,18, is there a better way to do it?
- is there a recursion patter that i could use on codeTree instead of doing the recursion myself? same with decode?
- i know how to hlint, but how do i profile it?
- can i make Tree a an instance of Functor and make the trav function cleaner? or maybe use the Writer monad?
- how can i bitpack in haskell?
- how can i make this take advantage of multiple cores? i think there are lots of good candidates but don't know where to start.
- to be of any use the code table needs to be outputted with the bits, is there a good marshaling module in haskell?
quickCheck issues:
- quickCheck (\s -> (length $ encode (codex s) s) < (length s)) blows up when passing it [] and [()], how do i debug this?
- is there a canonical way to put multiple quickChecks in a file for a suite? is it as simple as just rolling your own with something like mapM_ over all the tests?
thanks in advance guys