Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- class FileHandles a => TypedFiles7a a b where
- read7 :: Path Abs Dir -> Path Rel File -> TypedFile5 a b -> ErrIO b
- write7 :: Path Abs Dir -> Path Rel File -> TypedFile5 a b -> b -> ErrIO ()
- read8 :: Path Abs File -> TypedFile5 a b -> ErrIO b
- write8 :: Path Abs File -> TypedFile5 a b -> b -> ErrIO ()
- renameToBak8 :: Path Abs File -> TypedFile5 a b -> ErrIO ()
- class FileHandles a => TypedFiles7 a b where
- data GZip
- class FileHandles a => TypedFiles5 a b where
- write5 :: Path Abs Dir -> Path Rel File -> TypedFile5 a b -> a -> ErrIO ()
- append5 :: Path Abs Dir -> Path Rel File -> TypedFile5 a b -> a -> ErrIO ()
- read5 :: Path Abs Dir -> Path Rel File -> TypedFile5 a b -> ErrIO a
- write6 :: Path Abs File -> TypedFile5 a b -> a -> ErrIO ()
- openHandle6 :: Path Abs File -> TypedFile5 a b -> ErrIO Handle
- writeHandle6 :: Handle -> TypedFile5 a b -> a -> ErrIO ()
- closeHandle6 :: Path Abs File -> TypedFile5 a b -> Handle -> ErrIO ()
- append6 :: Path Abs File -> TypedFile5 a b -> a -> ErrIO ()
- read6 :: Path Abs File -> TypedFile5 a b -> ErrIO a
- exist6 :: Path Abs File -> TypedFile5 a b -> ErrIO Bool
- modificationTime6 :: Path Abs File -> TypedFile5 a b -> ErrIO EpochTime
- isTyped :: Path Abs File -> TypedFile5 a b -> Bool
- typedExtension :: TypedFile5 a b -> Extension
- makeTyped :: Extension -> TypedFile5 a b
- data TypedFile5 a b = TypedFile5 {}
- rdfGraphDebug :: Bool
- compress :: ByteString -> ByteString
- decompress :: ByteString -> ByteString
- type EpochTime = CTime
Documentation
class FileHandles a => TypedFiles7a a b where Source #
read7 :: Path Abs Dir -> Path Rel File -> TypedFile5 a b -> ErrIO b Source #
the 7 have two arguments for path and file
write7 :: Path Abs Dir -> Path Rel File -> TypedFile5 a b -> b -> ErrIO () Source #
read8 :: Path Abs File -> TypedFile5 a b -> ErrIO b Source #
the 8 versions have a single argument for path and file
write8 :: Path Abs File -> TypedFile5 a b -> b -> ErrIO () Source #
renameToBak8 :: Path Abs File -> TypedFile5 a b -> ErrIO () Source #
the createDir if missingis implied in the write
Instances
TypedFiles7 ByteString b => TypedFiles7a ByteString b Source # | |
Defined in Uniform.TypedFile read7 :: Path Abs Dir -> Path Rel File -> TypedFile5 ByteString b -> ErrIO b Source # write7 :: Path Abs Dir -> Path Rel File -> TypedFile5 ByteString b -> b -> ErrIO () Source # read8 :: Path Abs File -> TypedFile5 ByteString b -> ErrIO b Source # write8 :: Path Abs File -> TypedFile5 ByteString b -> b -> ErrIO () Source # renameToBak8 :: Path Abs File -> TypedFile5 ByteString b -> ErrIO () Source # | |
TypedFiles7 Text b => TypedFiles7a Text b Source # | |
Defined in Uniform.TypedFile read7 :: Path Abs Dir -> Path Rel File -> TypedFile5 Text b -> ErrIO b Source # write7 :: Path Abs Dir -> Path Rel File -> TypedFile5 Text b -> b -> ErrIO () Source # read8 :: Path Abs File -> TypedFile5 Text b -> ErrIO b Source # write8 :: Path Abs File -> TypedFile5 Text b -> b -> ErrIO () Source # renameToBak8 :: Path Abs File -> TypedFile5 Text b -> ErrIO () Source # |
class FileHandles a => TypedFiles7 a b where Source #
the a is the base type which is written on file, b is the type for input and output
Instances
class FileHandles a => TypedFiles5 a b where Source #
reads or writes a structured file with the specified parsers or writer the first parameter is the type of file, it is the type of the input data and the returned data the second an arbitrary differentiation to allow two file types with different extension and read the b can be () if no differentiation is desired
Nothing
write5 :: Path Abs Dir -> Path Rel File -> TypedFile5 a b -> a -> ErrIO () Source #
append5 :: Path Abs Dir -> Path Rel File -> TypedFile5 a b -> a -> ErrIO () Source #
read5 :: Path Abs Dir -> Path Rel File -> TypedFile5 a b -> ErrIO a Source #
write6 :: Path Abs File -> TypedFile5 a b -> a -> ErrIO () Source #
openHandle6 :: Path Abs File -> TypedFile5 a b -> ErrIO Handle Source #
writeHandle6 :: Handle -> TypedFile5 a b -> a -> ErrIO () Source #
create the file and open the handle should attache ".tmp" to extension and when closing rename to correct filename - > transaction completed
closeHandle6 :: Path Abs File -> TypedFile5 a b -> Handle -> ErrIO () Source #
append6 :: Path Abs File -> TypedFile5 a b -> a -> ErrIO () Source #
close the handle - with transaction
read6 :: Path Abs File -> TypedFile5 a b -> ErrIO a Source #
exist6 :: Path Abs File -> TypedFile5 a b -> ErrIO Bool Source #
check whether file exist
modificationTime6 :: Path Abs File -> TypedFile5 a b -> ErrIO EpochTime Source #
isTyped :: Path Abs File -> TypedFile5 a b -> Bool Source #
check if a given file is of the right type (extenions, not mime type)
typedExtension :: TypedFile5 a b -> Extension Source #
get the extension back
makeTyped :: Extension -> TypedFile5 a b Source #
Instances
data TypedFile5 a b Source #
rdfGraphDebug :: Bool Source #
compress :: ByteString -> ByteString #
Compress a stream of data into the gzip format.
This uses the default compression parameters. In particular it uses the default compression level which favours a higher compression ratio over compression speed, though it does not use the maximum compression level.
Use compressWith
to adjust the compression level or other compression
parameters.
decompress :: ByteString -> ByteString #
Decompress a stream of data in the gzip format.
There are a number of errors that can occur. In each case an exception will be thrown. The possible error conditions are:
- if the stream does not start with a valid gzip header
- if the compressed stream is corrupted
- if the compressed stream ends prematurely
Note that the decompression is performed lazily. Errors in the data stream may not be detected until the end of the stream is demanded (since it is only at the end that the final checksum can be checked). If this is important to you, you must make sure to consume the whole decompressed stream before doing any IO action that depends on it.