
a few weeks ago a question was posed on this list for examples how to use couchDB. i post the 'hello world' for couchDB using the haskell interface - perhaps it helps other to start! a more extensive and complicate example is found at www.maztravel.com/haskell/mySqlToCouchDB.html I created with Futon a db names "first" (i had no luck with names containing a - or a _ , but have not investigated further). the runcouchDB' affects the couchDB at localhost. andrew ps: if there is a better place to document examples? a wiki on haskell.org would be nice and should be available for any project in hackage. ---- {-# LANGUAGE DeriveDataTypeable #-} module Main ( ) where import Database.CouchDB import Data.Data (Typeable) import Text.JSON s1 = JSString $ toJSString "Peter" m1 = makeObj [("FirstName", s1), ("FamilytName", JSString . toJSString $ "Miller")] mydb1 = db "first" -- convert db name to checked couchdb -- problem with "-" or "_" in db names in haskell?? main = do putStrLn "start couchdb tests" (doc, rev) <- runCouchDB' $ newDoc mydb1 m1 -- works return ()

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 7/30/10 03:31 , Andrew U. Frank wrote:
ps: if there is a better place to document examples? a wiki on haskell.org would be nice and should be available for any project in hackage.
haskell.org has (more precisely, *is*) a wiki; request an account (http://haskell.org/haskellwiki/?title=Special:Userlogin&returnto=Haskell) and go nuts. - -- brandon s. allbery [linux,solaris,freebsd,perl] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.10 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkxS3ooACgkQIn7hlCsL25XYngCeLUJze41lkwlxXW0hsBTLhWBo d3cAn2FNQYNUn8kTczX6kFdbB5aKxGyp =hhDi -----END PGP SIGNATURE-----
participants (2)
-
Andrew U. Frank
-
Brandon S Allbery KF8NH