[darcs-devel] Expanding Slurpy

Ian Lynagh igloo at earth.li
Sun May 1 05:04:54 PDT 2005


On Sun, May 01, 2005 at 12:50:20PM +0200, Juliusz Chroboczek wrote:
> >     = SlurpDir  FileName !EpochTime a Maybe (IO ()) a [Slurpy a b]
> >     | SlurpFile FileName !Bool !EpochTime !FileOffset b FileContents
> 
> > Then a normal slurpy would be a
> >     Slurpy () ()
> > and a git slurpy a
> >     Slurpy String String
> >
> > Or do we need knowledge of what these things are in generic slurpy
> > functions?
> 
> Trouble is, we want to compare the hashes without asking ourselves
> questions about where the slurpy came from; e.g. do things like
> 
>   compare_slurpies s1 s2 | slurpy_hash s1 == slurpy_hash s2 = True
>   compare_slurpies (SlurpDir ... l) (slurpDir ... l) = 
>       descend_recursively-into_l

Hmm, OK. I was going to suggest

data Slurpy
    = SlurpDir  FileName !Comparable Maybe (IO ()) [Slurpy]
    | SlurpFile FileName !Comparable !Bool !FileOffset FileContents

data Comparable = NoComparable | EpochTime !EpochTime | GitHash String
               (| whatever monotone wants | whatever ...)
    deriving Eq

but I guess this won't work either as you also wanted an epochtime on
SlurpyDir for git? (what's that for, out of interest?)


Thanks
Ian





More information about the darcs-devel mailing list