ContentsIndex
Darcs.SlurpDirectory.Internal
Description
SlurpDirectory is intended to give a nice lazy way of traversing directory trees.
Synopsis
data Slurpy = Slurpy !FileName !SlurpyContents
slurpy_to_pair :: Slurpy -> (FileName, SlurpyContents)
pair_to_slurpy :: (FileName, SlurpyContents) -> Slurpy
type SlurpyMap = Map FileName SlurpyContents
slurpies_to_map :: [Slurpy] -> SlurpyMap
map_to_slurpies :: SlurpyMap -> [Slurpy]
data SlurpyContents
= SlurpDir (Maybe String) SlurpyMap
| SlurpFile (Maybe String, EpochTime, FileOffset) FileContents
type FileContents = ByteString
mapSlurpyNames :: (FileName -> FileName) -> Slurpy -> Slurpy
slurp :: FilePathLike p => p -> IO Slurpy
mmap_slurp :: FilePath -> IO Slurpy
slurp_unboring :: (FilePath -> Bool) -> FilePath -> IO Slurpy
empty_slurpy :: Slurpy
slurp_name :: Slurpy -> FilePath
is_file :: Slurpy -> Bool
is_dir :: Slurpy -> Bool
get_filecontents :: Slurpy -> FileContents
get_dircontents :: Slurpy -> [Slurpy]
get_mtime :: Slurpy -> EpochTime
get_length :: Slurpy -> FileOffset
data SlurpMonad a = SM (Either String Slurpy -> Either String (Slurpy, a))
mksm :: (Slurpy -> Either String (Slurpy, a)) -> SlurpMonad a
write_file :: Slurpy -> FileName -> IO ()
try_write_file :: Slurpy -> FilePath -> IO ()
ensureDirectories :: WriteableDirectory m => FileName -> m ()
write_files :: Slurpy -> [FilePath] -> IO ()
writeSlurpy :: Slurpy -> FilePath -> IO ()
withSlurpy :: Slurpy -> SlurpMonad a -> Either String (Slurpy, a)
smDoesDirectoryExist :: FileName -> SlurpMonad Bool
smDoesFileExist :: FileName -> SlurpMonad Bool
smInSlurpy :: FileName -> SlurpMonad a -> SlurpMonad a
fromSlurpFile :: FileName -> (Slurpy -> a) -> SlurpMonad a
modifySubSlurpy :: FileName -> SlurpMonad a -> SlurpMonad a
modifyFileSlurpy :: FileName -> (Slurpy -> Slurpy) -> SlurpMonad ()
insertSlurpy :: FileName -> Slurpy -> SlurpMonad ()
smReadFilePS :: FileName -> SlurpMonad ByteString
smReadFilePSs :: FileName -> SlurpMonad [ByteString]
smGetDirContents :: SlurpMonad [FileName]
smWriteFilePS :: FileName -> ByteString -> SlurpMonad ()
smCreateDirectory :: FileName -> SlurpMonad ()
smRename :: FileName -> FileName -> SlurpMonad ()
smRemove :: FileName -> SlurpMonad ()
smRemoveFile :: FileName -> SlurpMonad ()
smRemoveDirectory :: FileName -> SlurpMonad ()
slurp_fn :: Slurpy -> FileName
slurp_setname :: FileName -> Slurpy -> Slurpy
undefined_time :: EpochTime
undefined_size :: FileOffset
undef_time_size :: (Maybe String, EpochTime, FileOffset)
wait_a_moment :: IO ()
isFileReallySymlink :: FilePath -> IO Bool
doesFileReallyExist :: FilePath -> IO Bool
doesDirectoryReallyExist :: FilePath -> IO Bool
genslurp :: Bool -> (FilePath -> Bool) -> FilePath -> IO Slurpy
unsafeInterleaveMapIO :: (a -> IO b) -> [a] -> IO [b]
genslurp_helper :: Bool -> (FilePath -> Bool) -> FilePath -> String -> String -> IO (Maybe Slurpy)
not_hidden :: FilePath -> Bool
(\\\) :: FilePath -> FilePath -> FilePath
(///) :: FilePath -> FilePath -> FilePath
co_slurp :: Slurpy -> FilePath -> IO Slurpy
co_slurp_helper :: FilePath -> Slurpy -> IO (Maybe Slurpy)
get_slurp_context_generic :: (Slurpy -> a) -> (a -> [Slurpy]) -> FileName -> Slurpy -> Maybe (a -> a, Slurpy)
get_slurp_context :: FileName -> Slurpy -> Maybe (Slurpy -> Slurpy, Slurpy)
get_slurp_context_maybe :: FileName -> Slurpy -> Maybe (Maybe Slurpy -> Maybe Slurpy, Slurpy)
slurp_remove :: FileName -> Slurpy -> Maybe Slurpy
slurp_removefile :: FileName -> Slurpy -> Maybe Slurpy
slurp_move :: FileName -> FileName -> Slurpy -> Maybe Slurpy
addslurp :: FileName -> Slurpy -> Slurpy -> Slurpy
get_slurp :: FileName -> Slurpy -> Maybe Slurpy
slurp_removedir :: FileName -> Slurpy -> Maybe Slurpy
slurp_adddir :: FileName -> Slurpy -> Maybe Slurpy
slurp_modfile :: FileName -> (FileContents -> Maybe FileContents) -> Slurpy -> Maybe Slurpy
slurp_hasfile :: FileName -> Slurpy -> Bool
slurp_has :: FilePath -> Slurpy -> Bool
slurp_has_anycase :: FilePath -> Slurpy -> Bool
tolower :: FileName -> FileName
findSubSlurpy :: FileName -> SlurpyMap -> Maybe Slurpy
slurp_hasdir :: FileName -> Slurpy -> Bool
slurp_hasdir_private :: FileName -> Slurpy -> Bool
get_path_list :: Slurpy -> FilePath -> [FilePath]
get_path_list' :: Slurpy -> FilePath -> [FilePath]
list_slurpy :: Slurpy -> [FilePath]
list_slurpy_files :: Slurpy -> [FilePath]
list_slurpy_dirs :: Slurpy -> [FilePath]
unsyncedSlurpySize :: Slurpy -> Int
slurp_sync_size :: Int
syncSlurpy :: (Slurpy -> IO Slurpy) -> Slurpy -> IO Slurpy
Documentation
data Slurpy
Constructors
Slurpy !FileName !SlurpyContents
show/hide Instances
Eq Slurpy
Ord Slurpy
Show Slurpy
slurpy_to_pair :: Slurpy -> (FileName, SlurpyContents)
pair_to_slurpy :: (FileName, SlurpyContents) -> Slurpy
type SlurpyMap = Map FileName SlurpyContents
slurpies_to_map :: [Slurpy] -> SlurpyMap
map_to_slurpies :: SlurpyMap -> [Slurpy]
data SlurpyContents
Constructors
SlurpDir (Maybe String) SlurpyMap
SlurpFile (Maybe String, EpochTime, FileOffset) FileContents
type FileContents = ByteString
mapSlurpyNames :: (FileName -> FileName) -> Slurpy -> Slurpy
slurp :: FilePathLike p => p -> IO Slurpy
mmap_slurp :: FilePath -> IO Slurpy
slurp_unboring :: (FilePath -> Bool) -> FilePath -> IO Slurpy
empty_slurpy :: Slurpy
slurp_name :: Slurpy -> FilePath
is_file :: Slurpy -> Bool
is_dir :: Slurpy -> Bool
get_filecontents :: Slurpy -> FileContents
get_dircontents :: Slurpy -> [Slurpy]
get_mtime :: Slurpy -> EpochTime
get_length :: Slurpy -> FileOffset
data SlurpMonad a
Constructors
SM (Either String Slurpy -> Either String (Slurpy, a))
show/hide Instances
mksm :: (Slurpy -> Either String (Slurpy, a)) -> SlurpMonad a
write_file :: Slurpy -> FileName -> IO ()
try_write_file :: Slurpy -> FilePath -> IO ()
ensureDirectories :: WriteableDirectory m => FileName -> m ()
write_files :: Slurpy -> [FilePath] -> IO ()
writeSlurpy :: Slurpy -> FilePath -> IO ()
withSlurpy :: Slurpy -> SlurpMonad a -> Either String (Slurpy, a)
smDoesDirectoryExist :: FileName -> SlurpMonad Bool
smDoesFileExist :: FileName -> SlurpMonad Bool
smInSlurpy :: FileName -> SlurpMonad a -> SlurpMonad a
fromSlurpFile :: FileName -> (Slurpy -> a) -> SlurpMonad a
modifySubSlurpy :: FileName -> SlurpMonad a -> SlurpMonad a
modifyFileSlurpy :: FileName -> (Slurpy -> Slurpy) -> SlurpMonad ()
insertSlurpy :: FileName -> Slurpy -> SlurpMonad ()
smReadFilePS :: FileName -> SlurpMonad ByteString
smReadFilePSs :: FileName -> SlurpMonad [ByteString]
smGetDirContents :: SlurpMonad [FileName]
smWriteFilePS :: FileName -> ByteString -> SlurpMonad ()
smCreateDirectory :: FileName -> SlurpMonad ()
smRename :: FileName -> FileName -> SlurpMonad ()
smRemove :: FileName -> SlurpMonad ()
smRemoveFile :: FileName -> SlurpMonad ()
smRemoveDirectory :: FileName -> SlurpMonad ()
slurp_fn :: Slurpy -> FileName
Here are a few access functions.
slurp_setname :: FileName -> Slurpy -> Slurpy
undefined_time :: EpochTime
undefined_size :: FileOffset
undef_time_size :: (Maybe String, EpochTime, FileOffset)
wait_a_moment :: IO ()
isFileReallySymlink :: FilePath -> IO Bool
doesFileReallyExist :: FilePath -> IO Bool
doesDirectoryReallyExist :: FilePath -> IO Bool
genslurp :: Bool -> (FilePath -> Bool) -> FilePath -> IO Slurpy
slurp is how we get a slurpy in the first placeldots
unsafeInterleaveMapIO :: (a -> IO b) -> [a] -> IO [b]
genslurp_helper :: Bool -> (FilePath -> Bool) -> FilePath -> String -> String -> IO (Maybe Slurpy)
not_hidden :: FilePath -> Bool
(\\\) :: FilePath -> FilePath -> FilePath
(///) :: FilePath -> FilePath -> FilePath
co_slurp :: Slurpy -> FilePath -> IO Slurpy
co_slurp_helper :: FilePath -> Slurpy -> IO (Maybe Slurpy)
get_slurp_context_generic :: (Slurpy -> a) -> (a -> [Slurpy]) -> FileName -> Slurpy -> Maybe (a -> a, Slurpy)
get_slurp_context :: FileName -> Slurpy -> Maybe (Slurpy -> Slurpy, Slurpy)
get_slurp_context navigates to a specified filename in the given slurpy, and returns the child slurpy at that point together with a update function that can be used to reconstruct the original slurpy from a replacement value for the child slurpy.
get_slurp_context_maybe :: FileName -> Slurpy -> Maybe (Maybe Slurpy -> Maybe Slurpy, Slurpy)
A variant of get_slurp_context that allows for removing the child slurpy altogether by passing in Nothing to the update function. If the child slurpy happened to be at the top level and Nothing was passed in, then the result of the update function will also be Nothing, otherwise it will always be a Just value.
slurp_remove :: FileName -> Slurpy -> Maybe Slurpy

A variant of get_slurp_context that allows for replacing the child slurpy by a list of slurpies. The result of the update function will always be a singleton list unless the child slurpy was at the top level. Currently unused. get_slurp_context_list :: FileName -> Slurpy -> Maybe ([Slurpy] -> [Slurpy], Slurpy) get_slurp_context_list = get_slurp_context_generic return id

It is important to be able to readily modify a slurpy.

slurp_removefile :: FileName -> Slurpy -> Maybe Slurpy
slurp_move :: FileName -> FileName -> Slurpy -> Maybe Slurpy
addslurp :: FileName -> Slurpy -> Slurpy -> Slurpy
get_slurp :: FileName -> Slurpy -> Maybe Slurpy
slurp_removedir :: FileName -> Slurpy -> Maybe Slurpy
slurp_adddir :: FileName -> Slurpy -> Maybe Slurpy
slurp_modfile :: FileName -> (FileContents -> Maybe FileContents) -> Slurpy -> Maybe Slurpy
Code to modify a given file in a slurpy.
slurp_hasfile :: FileName -> Slurpy -> Bool
slurp_has :: FilePath -> Slurpy -> Bool
slurp_has_anycase :: FilePath -> Slurpy -> Bool
tolower :: FileName -> FileName
findSubSlurpy :: FileName -> SlurpyMap -> Maybe Slurpy
slurp_hasdir :: FileName -> Slurpy -> Bool
slurp_hasdir_private :: FileName -> Slurpy -> Bool
get_path_list :: Slurpy -> FilePath -> [FilePath]
get_path_list' :: Slurpy -> FilePath -> [FilePath]
list_slurpy :: Slurpy -> [FilePath]
list_slurpy_files :: Slurpy -> [FilePath]
list_slurpy_dirs :: Slurpy -> [FilePath]
unsyncedSlurpySize :: Slurpy -> Int
slurp_sync_size :: Int
syncSlurpy :: (Slurpy -> IO Slurpy) -> Slurpy -> IO Slurpy
Produced by Haddock version 2.4.2