Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

data files haskellized #1

Merged
merged 1 commit into from Apr 24, 2012

Conversation

Projects
None yet
2 participants
Contributor

michaelt commented Apr 23, 2012

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.

Owner

fosskers commented Apr 23, 2012

Interesting. That would get rid of my "where is my data" problem and purify a lot of nanq.hs.
One thing I was attempting to do was just have freely available .txt of the Kanji, as those are quite lacking I find on the internet. Perhaps I could separate them, make a new project for just the Kanji files, say "here they are" and then Haskellize them appropriately for my nanq project, as you've suggested.

fosskers added a commit that referenced this pull request Apr 24, 2012

Merge pull request #1 from michaelt/master
Data files turned into Haskell files.

@fosskers fosskers merged commit 2e1e175 into fosskers:master Apr 24, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment