I program vocabulary in Haskell in my free time.
I have a file with words where elements are modeled as algebraic data types that look like
Word { _frq=1 , _fra="le" , _eng="the; him, her, it, them" , _deu="der,die,das; er,sie,es" , _uses=[Determiner [], Pronoun []] , _phrase=" vive la politique, vive l'amour" , _sentence="long live politics, long live love" , _satz="Lang lebe die Politik, lang lebe die Liebe." }
Most often, the German translation of _deu= and _satz= most often represents an empty string that I want to update as part of the program.
Now I have a few questions: 1. Is there a database that uses Haskell data types for haskell (I would really like my type to have type safety too)? What I found are HDBC bindings to MySQL and the like, as well as some other xml / JSON stuff.
- If I update the file instead of using the database, is there a way to recompile the entire program - it would be a little tedious to do this.
and the third question
I want to save the studied dictionaries in a data structure that needs to be updated frequently, since at each stage of training I update a number indicating the knowledge of this word and sort this data structure when pasting / or after it. Then I select a new word based on its position in this data structure. Lists seem inefficient to do a full enumeration of the list, and sorting is a big effort if there is a better solution. Note, finally, I only have 5,000 entries in the list, so maybe this worries speed in the wrong place?
database algebraic-data-types haskell
epsilonhalbe
source share