announcing darcs

Alastair Reid alastair@reid-consulting-uk.ltd.uk
Wed, 09 Apr 2003 16:02:36 +0100


[moved from cafe to libraries]

David Roundy <droundy@abridgegame.org> 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/libcurl.so 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 (/='.') 

or

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

(try them on "/foo.bar/baz.exe" and "/foo.bar/baz") 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                 alastair@reid-consulting-uk.ltd.uk  
Reid Consulting (UK) Limited  http://www.reid-consulting-uk.ltd.uk/alastair/