-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | IO support for file handles in di-core
--   
--   IO support for file handles in di-core
@package di-handle
@version 1.0

module Di.Handle

-- | <a>Log</a>s are written to <a>stderr</a>, one per line.
--   
--   <i>WARNING</i> Currently this always renders as UTF-8.
stderr :: (MonadIO m, MonadIO n) => LineRenderer level path msg -> m (Log level path msg -> n ())

-- | Like <a>blob</a>, but each <a>Log</a> is rendered as text in its own
--   line.
--   
--   If the given <a>Handle</a> is associated to a TTY supporting ANSI
--   colors, and the given <a>LineRenderer</a> supports rendering with
--   colors, and you ask for it, then you will get colorful output.
handle :: (MonadIO m, MonadIO n) => Maybe Bool -> Handle -> LineRenderer level path msg -> m (Log level path msg -> n ())

-- | Write <a>Log</a>s to a <a>Handle</a> as a binary blob.
blob :: (MonadIO m, MonadIO n) => Handle -> BlobRenderer level path msg -> m (Log level path msg -> n ())

-- | How to render a <a>Log</a> as a line of text.
data LineRenderer level path msg

-- | The returned bytes must not contain a leading nor trailing newline.
--   
--   The <a>Bool</a> tells whether we are trying to write these bytes to a
--   terminal that supports ANSI colors.
LineRendererUtf8 :: !(Bool -> Log level path msg -> Builder) -> LineRenderer level path msg

-- | How to render a <a>Log</a> as a binary blob.
data BlobRenderer level path msg
BlobRenderer :: !(Log level path msg -> Builder) -> BlobRenderer level path msg
