say-0.1.0.1: Send textual messages to a Handle in a thread-friendly way

Safe Haskell | Safe-Inferred
Language | Haskell2010

Say

Contents

- Stdout
- Stderr
- Handle

Synopsis

- say :: MonadIO m => Text -> m ()
- sayString :: MonadIO m => String -> m ()
- sayShow :: (MonadIO m, Show a) => a -> m ()
- sayErr :: MonadIO m => Text -> m ()
- sayErrString :: MonadIO m => String -> m ()
- sayErrShow :: (MonadIO m, Show a) => a -> m ()
- hSay :: MonadIO m => Handle -> Text -> m ()
- hSayString :: MonadIO m => Handle -> String -> m ()
- hSayShow :: (MonadIO m, Show a) => Handle -> a -> m ()

# Stdout

say :: MonadIO m => Text -> m () Source #

Send a `Text` to standard output, appending a newline, and chunking the data. By default, the chunk size is 2048 characters, so any messages below that size will be sent as one contiguous unit. If larger messages are used, it is possible for interleaving with other threads to occur.

Since: 0.1.0.0

sayString :: MonadIO m => String -> m () Source #

Same as `say`, but operates on a `String`. Note that this will force the entire `String` into memory at once, and will fail for infinite `String`s.

Since: 0.1.0.0

sayShow :: (MonadIO m, Show a) => a -> m () Source #

Same as `say`, but for instances of `Show`.

If your `Show` instance generates infinite output, this will fail. However, an infinite result for `show` would generally be considered an invalid instance anyway.

Since: 0.1.0.0

# Stderr

sayErr :: MonadIO m => Text -> m () Source #

Same as `say`, but data is sent to standard error.

Since: 0.1.0.0

sayErrString :: MonadIO m => String -> m () Source #

Same as `sayString`, but data is sent to standard error.

Since: 0.1.0.0

sayErrShow :: (MonadIO m, Show a) => a -> m () Source #

Same as `sayShow`, but data is sent to standard error.

Since: 0.1.0.0

# Handle

hSay :: MonadIO m => Handle -> Text -> m () Source #

Same as `say`, but data is sent to the provided `Handle`.

Since: 0.1.0.0

hSayString :: MonadIO m => Handle -> String -> m () Source #

Same as `sayString`, but data is sent to the provided `Handle`.

Since: 0.1.0.0

hSayShow :: (MonadIO m, Show a) => Handle -> a -> m () Source #

Same as `sayShow`, but data is sent to the provided `Handle`.

Since: 0.1.0.0