This is a simple that uses HaskellDB and Haskell XML-RPC to create query a database containing the data from Foldoc. There are command line programs for building querying the database and an XML-RPC server that provides a metod for quering the database. * Get FOLDOC as a text file: rsync --times --progress rsync://foldoc.doc.ic.ac.uk:8873/foldoc/Dictionary . * Create database tables: CREATE TABLE foldoc_entries ( heading VARCHAR(255) NOT NULL, body TEXT NOT NULL, last_updated DATE NULL, KEY (heading) ); CREATE TABLE foldoc_entry_subjects ( heading VARCHAR(255) NOT NULL, subject VARCHAR(255) NOT NULL, KEY (heading), KEY (subject) ); heading should be primary key in foldoc_entries, but MySQL does case-insensitive matching on varchar, so that doesn't work. * Build database definition: DbDirect FoldocDB * Compile: $ make or $ ghc --make -o insert insert.hs $ ghc --make -o query query.hs $ ghc --make -o query foldocServer.hs * Insert data: ./insert * Make foldocServer available to the web server. * Test: $ ghci Prelude> (Network.XmlRpc.Client.remote "http://localhost/~bjorn/cgi-bin/foldocServer" "foldoc.getEntries" "Haskell" :: IO [String]) >>= mapM_ putStrLn