{-# LANGUAGE FlexibleInstances #-}
module Universum.Print.Internal (Print(..)) where
import qualified System.IO as SIO (hPutStr, hPutStrLn, Handle)
import qualified Data.ByteString.Char8 as BS
import qualified Data.ByteString.Lazy.Char8 as BL
import qualified Data.Text as T
import qualified Data.Text.IO as T
import qualified Data.Text.Lazy as TL
import qualified Data.Text.Lazy.IO as TL
import qualified Universum.Base as Base
class Print a where
hPutStr :: SIO.Handle -> a -> Base.IO ()
hPutStrLn :: SIO.Handle -> a -> Base.IO ()
instance Print T.Text where
hPutStr = T.hPutStr
hPutStrLn = T.hPutStrLn
instance Print TL.Text where
hPutStr = TL.hPutStr
hPutStrLn = TL.hPutStrLn
instance Print BS.ByteString where
hPutStr = BS.hPutStr
hPutStrLn = BS.hPutStrLn
instance Print BL.ByteString where
hPutStr = BL.hPutStr
hPutStrLn = BL.hPutStrLn
instance Print [Base.Char] where
hPutStr = SIO.hPutStr
hPutStrLn = SIO.hPutStrLn