module Text.JSON.Interact
(
Interact(..)
) where
import Data.ByteString
import qualified Data.ByteString as S
import Data.Text
import qualified Data.Text.IO as T
class Interact z where
getContents' ::
IO z
putStr' ::
z -> IO ()
interact' ::
(z -> z)
-> IO ()
interact' t =
putStr' . t =<< getContents'
instance Interact [Char] where
getContents' =
Prelude.getContents
putStr' =
Prelude.putStr
instance Interact ByteString where
getContents' =
S.getContents
putStr' =
S.putStr
instance Interact Text where
getContents' =
T.getContents
putStr' =
T.putStr