mattermost-api-50200.0.1: Client API for Mattermost chat system

Safe HaskellNone
LanguageHaskell2010

Network.Mattermost.Util

Synopsis

Documentation

assertE :: Exception e => Bool -> e -> IO () Source #

This asserts that the provided Bool is True, throwing a provided exception is the argument was False.

noteE :: Exception e => Maybe r -> e -> IO r Source #

This unwraps a Maybe value, throwing a provided exception if the value is Nothing.

hoistE :: Exception e => Either e r -> IO r Source #

This unwraps an Either value, throwing the contained exception if the Either was a Left value.

(~=) :: String -> String -> Bool Source #

Case Insensitive string comparison

withConnection :: ConnectionData -> (MMConn -> IO a) -> IO a Source #

Creates a new connection to Hostname from an already initialized ConnectionContext.

mkConnection :: ConnectionContext -> Hostname -> Port -> Bool -> IO MMConn Source #

Creates a connection from a ConnectionData value, returning it. It is the user's responsibility to close this appropriately.

connectionGetExact :: Connection -> Int -> IO ByteString Source #

Get exact count of bytes from a connection.

The size argument is the exact amount that must be returned to the user. The call will wait until all data is available. Hence, it behaves like hGet.

On end of input, connectionGetExact will throw an isEOFError exception. Taken from: https://github.com/vincenthz/hs-connection/issues/9