[Haskell-cafe] CouchDB module in Yhc source tree: clarification,
and small problems with other packages
Dimitry Golubovsky
golubovsky at gmail.com
Sat Jan 5 10:14:47 EST 2008
Hi,
Don asked:
> Are we likely to see the couchdb bindings released as a standalone
> library for the wider community?
Let me explain a little bit why the CouchDB module appears in the Yhc repo.
As the next stage of the Yhc/Javascript project, I am trying to set up
a web service where people might upload some Haskell code (or
reference to such code, these details haven't been clarified yet), and
get it compiled by background Yhc/ycr2js batch job, returning a HTML
page with Javascript in response.
CouchDB was picked* as intermediate storage for this project.
Therefore an interface module was needed, so I wrote one. This module,
`Database.CouchDB' is not 100% finished; it was coded up to satisfy
the needs of the first utility I wrote, `cdbup' which is currently
capable of uploading a text (utf-8 expected) or a binary file as a
document attachment to CouchDB. So some functionality hasn't been
coded yet, although it will definitely be, as the project develops.
Regarding packaging, I hope I will eventually put it on Hackage, but
there are some problems with another packages which I'll try to
explain here, so maybe those packages' developers suggest something.
1. Text.JSON. This module was picked from Jun Mukai's haskellnet
package (http://darcs.haskell.org/SoC/haskellnet/). One problem with
this package, it needs too many dependencies (while JSON module relies
only on Packrat parser). I had to extract the JSON module into Yhc
tree; can the haskellnet package be split somehow into orthogonal
sub-packages, and maybe one toplevel package which would pull all
parts together if used?
2. Text.JSON again. I had to change the pNumber function (parser for
numeric nodes) replacing the '1'..'9' digits range with '0' .. '9'.
Otherwise it did not handle JSON-encoded numbers equal to zero. I am
not sure I was 100% right, so perhaps some JSON experts here might
correct me.
3. Packrat parser does not seem to be packaged anywhere else, does it?
4. The dataenc package (http://code.haskell.org/dataenc/devo/) from
which I pulled the Codec.Binary.Base64 module. The package may need
some adjustment to GHC 6.8.x packages structure as only "base" listed
in build-depends does not seem to be enough: when building it, Cabal
complains for hidden packages such as collections (which I had to add
manually to the cabal file), etc. Is it some problem with my GHC
setup, or does just the dataenc.cabal need to be updated?
So, in order to get things done quicker, I pulled the said pieces from
their packages into Yhc tree. For packaging the CouchDB interface,
definitely these duplicates need to be removed.
Other packages that CouchDB relies upon, are**:
base, network, HTTP, filepath, base64-string, utf8-string
Thanks for the interest in CouchDB interface, and feel free to ask any
questions.
---
* before support form IBM/Apache was announced, but this recent
development definitely increases interest to CouchDB
** Just from the -package options I used to compile it; I may have
something omitted here.
--
Dimitry Golubovsky
Anywhere on the Web
More information about the Haskell-Cafe
mailing list