Copyright | (c) Serokell 2018 |
---|---|
License | MIT |
Maintainer | Serokell <hi@serokell.io> |
Stability | experimental |
Portability | portable |
Safe Haskell | Trustworthy |
Language | Haskell2010 |
Generalizes the putStr
family of functions for String likes such as lazy
and strict versions of Text
and ByteString
.
A caveat to using overloaded functions is that printing string literals raises
ambiguity errors in the presence of OverloadedStrings
. To avoid this problem
wither add a type annotation putStr ("Hello World!" :: Text)
or use one of the
type constrained functions putText
, putLText
etc.
You may add support for your own types by importing Universum.Print.Internal
and implementing Print
. However be advised that only the functions in this
module should be considered stable, not the interface for Print
.
Synopsis
- putStr :: (Print a, MonadIO m) => a -> m ()
- putStrLn :: (Print a, MonadIO m) => a -> m ()
- print :: forall a m. (MonadIO m, Show a) => a -> m ()
- class Print a
- putText :: MonadIO m => Text -> m ()
- putTextLn :: MonadIO m => Text -> m ()
- putLText :: MonadIO m => Text -> m ()
- putLTextLn :: MonadIO m => Text -> m ()
- hPutStr :: (Print a, MonadIO m) => Handle -> a -> m ()
- hPutStrLn :: (Print a, MonadIO m) => Handle -> a -> m ()
- hPrint :: (MonadIO m, Show a) => Handle -> a -> m ()
Documentation
putStrLn :: (Print a, MonadIO m) => a -> m () Source #
Write a string like value to stdout
appending a newline character.
Support class to overload writing of string like values.
putLTextLn :: MonadIO m => Text -> m () Source #
Writing strings to an arbitrary Handle
hPutStr :: (Print a, MonadIO m) => Handle -> a -> m () Source #
Write a string like value a
to a supplied Handle
.