Safe Haskell | None |
---|
Common types used internally. Re-exports the ByteString
type to use as well as some monad transformer stuff, exceptions, logging, Word
and printf.
- type ByteString = ByteString
- pack :: [Word8] -> ByteString
- unpack :: ByteString -> [Word8]
- bdrop :: Int64 -> ByteString -> ByteString
- btake :: Int64 -> ByteString -> ByteString
- blength :: ByteString -> Int64
- readFile :: FilePath -> IO ByteString
- class (Eq address, Show address, Monad m, MonadIO m) => MessageIO m address | m -> address where
- sendTo :: address -> ByteString -> m Bool
- receiveFrom :: Maybe Int -> m (Maybe (address, ByteString))
- localAddress :: m address
- module Control.Monad
- module Control.Applicative
- module Control.Monad.IO.Class
- module Control.Monad.State.Class
- module Control.Monad.Trans.State.Strict
- module Control.Monad.Trans.Class
- module Control.Exception
- module System.Log.Logger
- module System.Log.Handler.Simple
- module Data.Word
- module Text.Printf
Documentation
type ByteString = ByteStringSource
Alias for the Lazy ByteString that is used internally
pack :: [Word8] -> ByteString
O(n) Convert a '[Word8]' into a ByteString
.
unpack :: ByteString -> [Word8]
O(n) Converts a ByteString
to a '[Word8]'.
bdrop :: Int64 -> ByteString -> ByteStringSource
Candy for ByteString.pack to not interfere with Prelude(drop)
btake :: Int64 -> ByteString -> ByteStringSource
Candy for ByteString.take
blength :: ByteString -> Int64Source
Candy for ByteString.length
readFile :: FilePath -> IO ByteString
Read an entire file lazily into a ByteString
.
The Handle will be held open until EOF is encountered.
class (Eq address, Show address, Monad m, MonadIO m) => MessageIO m address | m -> address whereSource
Type class for monads that can send/receive messages
sendTo :: address -> ByteString -> m BoolSource
Send a message or return False
when there was an error
receiveFrom :: Maybe Int -> m (Maybe (address, ByteString))Source
Receive a message, failing if no message was receive after a timeout (measured in seconds)
localAddress :: m addressSource
Return the address that receiveFrom
receives on
module Control.Monad
module Control.Applicative
module Control.Monad.IO.Class
module Control.Monad.State.Class
module Control.Monad.Trans.Class
module Control.Exception
module System.Log.Logger
module System.Log.Handler.Simple
module Data.Word
module Text.Printf