Network-NineP-0.2.0: High-level abstraction over 9P protocol

PortabilityI'm too young to die
StabilityUltra-Violence
Safe HaskellNone

Network.NineP.File

Description

Higher-level file patterns. Don't support read/write operations at offsets and handling stat changes as for now.

Synopsis

Documentation

simpleFile :: forall a b m rr wr. (Monad m, EmbedIO m, ReadRef rr m a, Convertible a ByteString, WriteRef wr m b, Convertible ByteString b) => String -> rr -> wr -> NineFile mSource

A file that reads from and writes to the supplied Ref instances, with converstion to the appropriate types. See Instances, Instances and Instances. Use '()', if the file is meant to be read-only/write-only.

simpleFileBy :: forall a b m. (Monad m, EmbedIO m) => String -> (m a, b -> m ()) -> (a -> ByteString, ByteString -> b) -> NineFile mSource

Typeclass-free version of simpleFile.

rwFileSource

Arguments

:: forall m . EmbedIO m 
=> String

File name

-> Maybe (m ByteString)

Read handler

-> Maybe (ByteString -> m ())

Write handler

-> NineFile m 

A file that reads and writes using simple user-specified callbacks.