darcs-beta- a distributed, interactive, smart revision control system




type PatchCheck = State KnownStateSource

PatchCheck is a state monad with a simulated repository state

is_valid :: PatchCheck BoolSource

Returns true if the current repository state is not inconsistent

do_verbose_check :: PatchCheck a -> aSource

Run a check, and print the final repository state



:: String

Name of the file to check

-> PatchCheck Bool 

Checks if a file is empty

data FileContents Source

File contents are represented by a map from line numbers to line contents. If for a certain line number, the line contents are Nothing, that means that we are sure that that line exists, but we don't know its contents. We must also store the greatest line number that is known to exist in a file, to be able to exclude the possibility of it being empty without knowing its contents.