Hello

I'm finding darcs's diff command to be unusably slow for large repositories, so I'm trying to speed it up. Darcs seems to do diff by making two copies of the repository, with different patches applied on each, which results in a lot of unnecessary work in the normal case where we only care about a small number of files. It would be much better if it only touched the files it needs to.

It looks like it ought to be possible to make patch application use a SlurpMonad instead of the IO monad, and then pull the modifications out.

If I understand things correctly, I do something like this:
import Patch (apply)
apply_stuff_to_slurp_monad :: Stuff -> SlurpMonad ()
apply_stuff_to_slurp_monad stuff = do
  ...
  ...
  apply blah blah patch1
  apply blah blah patch2

then use it with something like:
get_file_contents :: OtherStuff -> [FilePath] -> IO ([PackedString])
get_file_contents otherstuff files = do
   s <- slurp pristine
   case (apply_stuff_to_slurp_monad stuff) >>= (MapM mReadFilePS files)) of
      SM func -> func s

I'm not good with Haskell, and I don't really understand monads well, so I'd like to know whether this approach is possible and/or sane, or whether there is a better way, before I spend too much time failing to implement it.

Edwin

_______________________________________________
darcs-devel mailing list
[email protected]
http://www.abridgegame.org/cgi-bin/mailman/listinfo/darcs-devel

Reply via email to