announcing darcs

Alastair Reid
Wed, 09 Apr 2003 16:02:36 +0100

[moved from cafe to libraries]

David Roundy <> writes:
> [darcs] contains a few bits of code that you might find useful,
> such as an interface to libcurl (for lazily reading files over http
> or ftp)

This sounds like it would be a valuable contribution all by itself.
Could you make it available as a package with its own (copy of the)
license?  A very brief look at the existing network support suggests 
that Network/C_URL might be a good place to put it.

A quick glance at libcurl documentation suggests that it is quite
portable (unix and win32).

> darcs is currently unix-only (counting MacOS X as unix).  A port to
> windows would be a fair amount of work, but probably would mostly be
> straightforward (mostly dealing with slashes versus backslashes and
> getting libcurl to work under windows). 

This reminds me of a library I have been wanting for a while:
functions for manipulating filenames in a portable way.  The main
requirement is that you should be able to manipulate a filepath as
though it was structured something like so:

  (Maybe [Directory], Maybe Filename, Maybe Suffix)

For example, on a Unix system, /usr/lib/ would be
treated something like this:

  (Just ["/","usr","lib"], "libcurl", Just "so")

There's an awful lot of code out there that assumes that you can find
the suffix of a filename using

  dropWhile (/='.') 


  reverse . takeWhile (/='.') . reverse

(try them on "/" and "/") and there is
(presumably) much reinvention of the wheel when people decide to 
implement functions which really work.

Oh yes, I should say that 'darcs' sounds quite cool as well...

Alastair Reid         
Reid Consulting (UK) Limited