{-# LANGUAGE ExplicitForAll #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE Trustworthy #-}
module Universum.Print
( putStr
, putStrLn
, print
, Print
, putText
, putTextLn
, putLText
, putLTextLn
, hPutStr
, hPutStrLn
, hPrint
) where
import Data.Function ((.))
import Universum.Monad.Reexport (MonadIO, liftIO)
import Universum.Print.Internal (Print)
import qualified Universum.Print.Internal as I (hPutStrLn, hPutStr)
import qualified Prelude (print)
import qualified System.IO as SIO (Handle, hPrint)
import qualified Data.Text as T
import qualified Data.Text.Lazy as TL
import qualified Universum.Base as Base
hPutStr :: (Print a, MonadIO m) => SIO.Handle -> a -> m ()
hPutStr :: Handle -> a -> m ()
hPutStr Handle
h = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> (a -> IO ()) -> a -> m ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Handle -> a -> IO ()
forall a. Print a => Handle -> a -> IO ()
I.hPutStr Handle
h
{-# SPECIALIZE hPutStr :: Print a => SIO.Handle -> a -> Base.IO () #-}
hPutStrLn :: (Print a, MonadIO m) => SIO.Handle -> a -> m ()
hPutStrLn :: Handle -> a -> m ()
hPutStrLn Handle
h = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> (a -> IO ()) -> a -> m ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Handle -> a -> IO ()
forall a. Print a => Handle -> a -> IO ()
I.hPutStrLn Handle
h
{-# SPECIALIZE hPutStrLn :: Print a => SIO.Handle -> a -> Base.IO () #-}
putStr :: (Print a, MonadIO m) => a -> m ()
putStr :: a -> m ()
putStr = Handle -> a -> m ()
forall a (m :: * -> *). (Print a, MonadIO m) => Handle -> a -> m ()
hPutStr Handle
Base.stdout
{-# SPECIALIZE putStr :: Print a => a -> Base.IO () #-}
putStrLn :: (Print a, MonadIO m) => a -> m ()
putStrLn :: a -> m ()
putStrLn = Handle -> a -> m ()
forall a (m :: * -> *). (Print a, MonadIO m) => Handle -> a -> m ()
hPutStrLn Handle
Base.stdout
{-# SPECIALIZE putStrLn :: Print a => a -> Base.IO () #-}
print :: forall a m . (MonadIO m, Base.Show a) => a -> m ()
print :: a -> m ()
print = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> (a -> IO ()) -> a -> m ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. a -> IO ()
forall a. Show a => a -> IO ()
Prelude.print
{-# SPECIALIZE print :: Base.Show a => a -> Base.IO () #-}
hPrint :: (MonadIO m, Base.Show a) => SIO.Handle -> a -> m ()
hPrint :: Handle -> a -> m ()
hPrint Handle
h = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> (a -> IO ()) -> a -> m ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Handle -> a -> IO ()
forall a. Show a => Handle -> a -> IO ()
SIO.hPrint Handle
h
{-# SPECIALIZE hPrint :: Base.Show a => SIO.Handle -> a -> Base.IO () #-}
putText :: MonadIO m => T.Text -> m ()
putText :: Text -> m ()
putText = Text -> m ()
forall a (m :: * -> *). (Print a, MonadIO m) => a -> m ()
putStr
{-# SPECIALIZE putText :: T.Text -> Base.IO () #-}
putTextLn :: MonadIO m => T.Text -> m ()
putTextLn :: Text -> m ()
putTextLn = Text -> m ()
forall a (m :: * -> *). (Print a, MonadIO m) => a -> m ()
putStrLn
{-# SPECIALIZE putTextLn :: T.Text -> Base.IO () #-}
putLText :: MonadIO m => TL.Text -> m ()
putLText :: Text -> m ()
putLText = Text -> m ()
forall a (m :: * -> *). (Print a, MonadIO m) => a -> m ()
putStr
{-# SPECIALIZE putLText :: TL.Text -> Base.IO () #-}
putLTextLn :: MonadIO m => TL.Text -> m ()
putLTextLn :: Text -> m ()
putLTextLn = Text -> m ()
forall a (m :: * -> *). (Print a, MonadIO m) => a -> m ()
putStrLn
{-# SPECIALIZE putLTextLn :: TL.Text -> Base.IO () #-}