fosskers/nanq — pull request #1 by michaelt (2012-04-23 18:13:14+00:00)
Title: data files haskellized

This isn't really a pull request but a possible suggestion. I was looking at the Stackoverflow question, and didnt really see why you needed a data dir. I constructed this Kanji subdir quickly in ghci, and probably named it wrongly. I doubt it adds much weight to the program. Something like this presupposes that you don't imagine the user managing his kanji-level database of course. If it is possible this way, you can get the IO out of KanjiQ.hs and also purify some of the functions in nanq.hs, moving them to KanjiCalculations.hs or whatever. I mean the definitions toward the end where you are doing statistics etc inside IO like so

do
qs <- allQs
... statistics...
putStrLn ....

By the way, you can get cabalization going very quickly if you follow the prompts that come from `cabal init` in the main directory. This would make a bit more sense if the directory were arranged hierarchically. You still have to add stuff under the dependencies field, but 'cabal configure' will tell you what they are soon enough.

Functions for the taking of averages and that sort of thing should be done in a 'pure' module, which will probably give you new ideas of things to do.