- type PatchCheck = State KnownState
- do_check :: PatchCheck a -> a
- file_exists :: String -> PatchCheck Bool
- dir_exists :: String -> PatchCheck Bool
- remove_file :: String -> PatchCheck Bool
- remove_dir :: String -> PatchCheck Bool
- create_file :: String -> PatchCheck Bool
- create_dir :: String -> PatchCheck Bool
- insert_line :: String -> Int -> ByteString -> PatchCheck Bool
- delete_line :: String -> Int -> ByteString -> PatchCheck Bool
- is_valid :: PatchCheck Bool
- do_verbose_check :: PatchCheck a -> a
- file_empty :: String -> PatchCheck Bool
- check_move :: String -> String -> PatchCheck Bool
- modify_file :: String -> (Maybe FileContents -> Maybe FileContents) -> PatchCheck Bool
- data FileContents = FC {
- fc_lines :: Map Int ByteString
- fc_maxline :: Int
Documentation
type PatchCheck = State KnownStateSource
PatchCheck is a state monad with a simulated repository state
do_check :: PatchCheck a -> aSource
dir_exists :: String -> PatchCheck BoolSource
remove_dir :: String -> PatchCheck BoolSource
create_dir :: String -> PatchCheck BoolSource
insert_line :: String -> Int -> ByteString -> PatchCheck BoolSource
delete_line :: String -> Int -> ByteString -> PatchCheck BoolSource
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
check_move :: String -> String -> PatchCheck BoolSource
modify_file :: String -> (Maybe FileContents -> Maybe FileContents) -> PatchCheck BoolSource
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.
FC | |
|