conduit-vfs-0.1.0.3: Virtual file system for Conduit; disk, pure, and in-memory impls.

Safe HaskellNone
LanguageHaskell2010

Data.Conduit.VFS.Pure

Description

This is intended primarily to be a drop-in testing mock for VFS implementations, but you may also find it useful within your program if you want to work with some hierarchically-organized data.

Individual read and write operations are atomic.

The FilePath values used in this VFS are split using splitPath and joined using </>, but are otherwise used directly: there is no concept of paths being "relative" or "absolute" for this VFS. It is also possible for a file and a directory to have the same name, since directories names are appended with /, as per splitPath. (This implementation detail is up for debate and may be changed in a future major release: please file an issue if you want to have a discussion around it.)

Synopsis

Documentation

data PureVFS m a Source #

The basic implementation of the VFS.

Instances
MonadTrans PureVFS Source # 
Instance details

Defined in Data.Conduit.VFS.Pure

Methods

lift :: Monad m => m a -> PureVFS m a #

Monad m => Monad (PureVFS m) Source # 
Instance details

Defined in Data.Conduit.VFS.Pure

Methods

(>>=) :: PureVFS m a -> (a -> PureVFS m b) -> PureVFS m b #

(>>) :: PureVFS m a -> PureVFS m b -> PureVFS m b #

return :: a -> PureVFS m a #

fail :: String -> PureVFS m a #

Functor m => Functor (PureVFS m) Source # 
Instance details

Defined in Data.Conduit.VFS.Pure

Methods

fmap :: (a -> b) -> PureVFS m a -> PureVFS m b #

(<$) :: a -> PureVFS m b -> PureVFS m a #

MonadFail m => MonadFail (PureVFS m) Source # 
Instance details

Defined in Data.Conduit.VFS.Pure

Methods

fail :: String -> PureVFS m a #

Monad m => Applicative (PureVFS m) Source # 
Instance details

Defined in Data.Conduit.VFS.Pure

Methods

pure :: a -> PureVFS m a #

(<*>) :: PureVFS m (a -> b) -> PureVFS m a -> PureVFS m b #

liftA2 :: (a -> b -> c) -> PureVFS m a -> PureVFS m b -> PureVFS m c #

(*>) :: PureVFS m a -> PureVFS m b -> PureVFS m b #

(<*) :: PureVFS m a -> PureVFS m b -> PureVFS m a #

Monad m => VFSC (PureVFS m) Source #

A class denoting that the type is usable as VFS conduits for reading and writing.

Instance details

Defined in Data.Conduit.VFS.Pure

Monad m => WriteVFSC (PureVFS m) Source #

A class denoting that the type is usable as VFS conduits for writing.

Instance details

Defined in Data.Conduit.VFS.Pure

Monad m => ReadVFSC (PureVFS m) Source # 
Instance details

Defined in Data.Conduit.VFS.Pure

runPureVFS :: PureVFS m a -> m (a, PNode) Source #

Given a PureVFS, run it in the local monad and return both the monadic return value and the root node of the VFS.

runPureVFS' :: Monad m => PureVFS m a -> m PNode Source #

Given a PureVFS, run it in the local monad and return the root node of the VFS.

runPureVFS_ :: Monad m => PureVFS m a -> m () Source #

Given a PureVFS, run it in the local monad and disregard any results.